""" 9999… が最大っぽい """ 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 <= 3: M = int(3.14159 * (10**N)) mulmax = 0 mulnum = 0 maxA,maxB = None,None 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) maxA,maxB = A,B elif digsum(A*B) == mulmax: mulnum += 1 print (mulmax,mulnum) #print (maxA,maxB) else: print (18*(N-3) + 62 , 1)