N = int(input()) for i in range(1,14000): if i//7*6+N<=i: print(i) exit()