print('285714'[~-int(input()) % 6])