import sys from sys import stdin def digsum(X): ret = 0 while X: ret += X % 10 X //= 10 return ret N = int(stdin.readline()) if N == 0: print (9,1) elif N == 1: M = int(3.14159 * (10**N)) mulmax = 0 mulnum = 0 for B in range(1,M+1): for A in range(1,B+1): if digsum(A*B) > mulmax: mulmax = digsum(A*B) mulnum = 1 #print (A,B) elif digsum(A*B) == mulmax: mulnum += 1 print (mulmax,mulnum) else: print (9*N,2)