x = int(input()) p = [2,2,-1,-1,2,-1,-1] i = l = s = 0 while i != x: d = p[s%7] i += d l += abs(d) s += 1 print(l)