X = int(input()) A = 2 B = -1 move = [2, 2, -1, -1, 2, -1, -1] now_point = 0 move_total = 0 for i in range(100): for j in move: now_point += j move_total += abs(j) if now_point == X: print(move_total) break