//Bai 2
#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin
#define en end
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
ll Factorial (ll n)
{
if(n == 0 || n == 1) return 1;
return n * Factorial(n - 1);
}
void Run(ll n)
{
cin >> n;
ll ans = Factorial(n);
string s = to_string(ans);
ll dem = 0;
for(int i = s.size() - 1; i >= 0; i--)
{
if(s[i] == '0') dem++;
else break;
}
cout << ans << " " << dem;
}
int main()
{
Faster;
ll n;
Run(n);
return 0;
}
Ly9CYWkgMgoKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4KI2RlZmluZSBlbiBlbmQKI2RlZmluZSBGYXN0ZXIgY2luLnRpZSgwKTsgY291dC50aWUoMCk7IGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CmxsIEZhY3RvcmlhbCAobGwgbikKewogICAgaWYobiA9PSAwIHx8IG4gPT0gMSkgcmV0dXJuIDE7CiAgICByZXR1cm4gbiAqIEZhY3RvcmlhbChuIC0gMSk7Cn0Kdm9pZCBSdW4obGwgbikKewogICAgY2luID4+IG47CiAgICBsbCBhbnMgPSBGYWN0b3JpYWwobik7CiAgICBzdHJpbmcgcyA9IHRvX3N0cmluZyhhbnMpOwogICAgbGwgZGVtID0gMDsKICAgIGZvcihpbnQgaSA9IHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pCiAgICB7CiAgICAgICAgaWYoc1tpXSA9PSAnMCcpIGRlbSsrOwogICAgICAgIGVsc2UgYnJlYWs7CiAgICB9CiAgICBjb3V0IDw8IGFucyA8PCAiICIgPDwgZGVtOwp9CmludCBtYWluKCkKewogICAgRmFzdGVyOwogICAgbGwgbjsKICAgIFJ1bihuKTsKICAgIHJldHVybiAwOwp9Cgo=