import java.util.*;
public class Main{
static int a[]=new int[2];
static int count=0;
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int n=s.nextInt();
a[0]=1;
a[1]=2;
f(n,0);
System.out.print(count);
}
static void f(int n, int sum){
if(sum==n){
count++;
return;
}
else if(sum>n)
{
return;
}
else{
for(int i=0;i<2;i++){
f(n,sum+a[i]);
}
}
}
} |
|