N = int(input()) while N != 1: N = N + N - 1 print(N)