# Author: Manfred Scheucher
# Date  : 04.06.2015 

from sys import argv
from copy import copy


def valid(x):
	G = copy(F)
	for y in [1..x]:
		d = gcd(x,y)
		r = gcd(G[x],G[y])
		if G[d] == 0:
			G[d] = r
		else:
			if G[d] != r:
				return False
	return True


def enum(x=0):
	if not valid(x): return

	if x == n:
		global ct
		ct += 1
		#print F
	else:
		for y in [1..n]:
			F[x+1] = y
			enum(x+1)


n = int(argv[1])
ct = 0

F = {x:0 for x in [1..n]}

enum()
print n,ct