#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{long long a;
int p[21], q[21]; long i,j,k,m;
cin>>a;
j=2; m=0;
do
{k=0;
while(a%j==0)
{a=a/j;++k;}
if(k!=0)
{++m;p[m]=j;q[m]=k;}
if (j>2)
j+=2;
else
j=3;
}
while(a!=1);
cout<<m<<endl;
for(i=1;i<=m;i++)
cout<<p[i]<<" "<<q[i]<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}