import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int month = sc.nextInt();
            fun(month);
        }
    }

    public static void fun(int month){
        // dp代表成熟的兔子
        int[] dp = new int[month + 1];
        // dp1代表未成熟1个月的兔子
        int[] dp1 = new int[month + 1];
        // dp2代表未成熟2个月的兔子
        int[] dp2 = new int[month + 1];

        if(month == 1 || month == 2){
            System.out.println(1);
            return;
        }
        dp[0] = 0; dp1[0] = 0; dp2[0] = 0;
        dp[1] = 0; dp1[1] = 1; dp2[1] = 0;
        dp[2] = 0; dp1[2] = 0; dp2[2] = 1;

        for(int i = 3; i <= month; ++i){
            int temp = dp2[i - 1];
            dp2[i] = dp1[i - 1];
            dp1[i] = dp[i - 1] + temp;
            dp[i] = dp[i - 1] + temp;
        }
        System.out.println(dp[month] + dp1[month] + dp2[month]);
    }
}