#include <iostream>
using namespace std;


 int main()
{
	int num , count = 0 , k = 0;

cin >> num;

	for (int i = num; i > 0; i-- )
	{

		if ( i % 5 == 0 )
		{
			//k = i;
			//cout << i << 999999 << endl;

			while(1){
				if( k == 0 ) k = i;

				k = k / 5;
				count++;
				cout << k << " " << count << endl; 
				if( k % 5 != 0 ){
					k = 0;
					break;
				} 
					
			}
			//cout << k << endl;
			//if( k % 5 != 0 ){
				//k = i / 5;
				//count++;

				//cout << k << endl;
				//continue;
				
				
			
		}
	}
	
	cout << count << endl;

	return 0;
}