print('7894561230'[int(input())-1])