X = int(input()) ans = 0 x = 0 dx = [2, -1] for _ in range(100): x += dx[0] ans += 2 if X == x: break x += dx[0] ans += 2 if X == x: break x += dx[1] ans += 1 if X == x: break x += dx[1] ans += 1 if X == x: break x += dx[0] ans += 2 if X == x: break x += dx[1] ans += 1 if X == x: break x += dx[1] ans += 1 if X == x: break print(ans)