import java.util.*;
class Main{
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
int n=in.nextInt();
int a[][]=new int [n+1][n+1];
int f[][]=new int [n+1][n+1];
for(int i=1;i[HTML_REMOVED]=1;i–) {
for(int j=1;j<n;j++) {
f[i][j]+=Math.max(f[i+1][j], f[i+1][j+1])+a[i][j];
}
}
System.out.println(f[1][1]);
}
}