n = int(input()) # 设出生1天的兔子有n1只,出生2天的兔子有n2只,成熟的兔子有m只 n1 = 1 n2 = 0 m = 0 total = 1 i = 1 while i < n: m += n2 lastN1 = n1 n1 = m n2 = lastN1 i += 1 total = n1 + n2 + m print(total)