package lanqiaobei003;
import java.util.Scanner;
public class Integer_divide {
static int[][] aa;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
aa = new int[n+1][n+1];
long start1 = System.nanoTime();
System.out.println(p(n,n));
long end1 = System.nanoTime();
System.out.println("优化前使用的时间:"+(end1-start1));
System.out.println("------------------------------------");
long start = System.nanoTime();
System.out.println(q(n,n));
long end = System.nanoTime();
System.out.println("优化后使用的时间:"+(end-start));
}
private static int p(int n, int m) {
if(n==1||m==1) return 1;
else if(n<m) return q(n,n);
else if(n==m) return 1+q(n,m-1);
else if(n>m&&m>1) return q(n,m-1)+q(n-m,m);
else return 0;
}
private static int q(int n, int m) {
if(n==1||m==1) return aa[n][m] = 1;
else if(n<m) {
if(aa[n][m]!=0) {
return aa[n][m];
}else {
return aa[n][m]=q(n,n);
}
}
else if(n==m) {
if(aa[n][n]!=0) {
return aa[n][n];
}else {
return aa[n][n] = 1+q(n,m-1);
}
}
else if(n>m&&m>1) {
if(aa[n][m]!=0) {
return aa[n][m];
}else {
return aa[n][m] = q(n,m-1)+q(n-m,m);
}
}
else return 0;
}
}