n = int(input()) print('47891564230'[n])