#include <iostream>
using namespace std;
//看博友分析重要 抄博友程序 规律背
void pri(int n)
{
for(int i=n/2,k=n-2;i>=1;i--)
{
cout<<i<<" 2 "<<k<<endl;
k--;
}
cout<<2<<" "<<n/2<<" "<<n/2+1<<endl;
}
int main()
{
int n;
cin>>n;
if(n==1)
{
cout<<0<<endl;
}else if(n==2)
{
cout<<1<<endl;
cout<<"1 1 1"<<endl;
}else if(n%2==1)
{
cout<<n/2+1<<endl;
pri(n);
}else
{
cout<<(n-1)/2+1+1<<endl;
pri(n-1);
cout<<1<<" "<<n-1<<" "<<1<<endl;
}
return 0;
}