""" """ a = 0 b = 0 X = int(input()) for i in range(100): if i % 7 in (0,1,4): a += 2 b += 2 else: a -= 1 b += 1 if a == X: print (b) break