x = int(input()) pt, ln = 0, 0 for _ in range(100): for k in [2, 2, -1, -1, 2, -1, -1]: pt += k ln += abs(k) if x == pt: print(ln) break ### ## #