import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
int n = in.nextInt();
if(n>0 && n<55) {
int i = CowStory(n);
System.out.println(i);
}else if(n==0) {
continue;
}
}
}
public static int CowStory(int n) {
if(n==1) {
return 1;
}else if(n==2){
return 2;
}else if(n==3){
return 3;
}
else {
return CowStory(n-3)+CowStory(n-1);
}
}
}