You are on page 1of 1

import java.io.

*
import java.util.*

public class f(){


public static int findStep(int n)
{
if (n==1||n==0)
return 1;
else if (n==2)
return 2;

else
return findStep(n-3)+findStep(n-2)+findStep(n-1);
}
public static void main(String argc[]){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
System.out.println(findStep(a));
}
}

You might also like