from itertools import cycle import sys def main(): input = lambda: sys.stdin.readline()[:-1] X = int(input()) ab = (2, 2, -1, -1, 2, -1, -1) ans, x = 0, 0 for n in cycle(ab): x += n ans += abs(n) if x == X: print(ans) break if not __debug__: f = open(sys.argv[1], "r") sys.stdin = f main()