x = int(input()) ans = 0 now = 0 comm = 'AABBABB' while now != x: for c in comm: if c == 'A': now += 2 ans += 2 else: now -= 1 ans += 1 if now == x: break print(ans)