X = int(input())

li = [2,2,-1,-1,2,-1,-1]
ans = 0
now = 0
for _ in range(10):
    for x in li:
        now += x
        ans += abs(x)
        if now == X:
            print(ans)
            exit()