import sys input = sys.stdin.readline x = int(input()) move = [2, 2, -1, -1, 2, -1, -1] now = 0 ans = 0 for _ in [0] * 100: for d in move: now += d ans += abs(d) if(now == x): exit(print(ans))