print([7,78,915,2910,222][int(input())-1])