n = int(input()) c = 0 t = 0 while n != t: if c%7 == 1 or c%7 == 2 or c%7 == 5: t += 2 c += 2 else: t -= 1 c += 1 print(c)