#include <stdio.h> int main() { int n, m; while (scanf("%d %d", &n, &m) != EOF) { int dp[8][8]; for(int i = 0; i <= n; i++) { dp[i][0] = 1; // printf("dp[%d][0] is %d\n", i, dp[i][0]); } for(int j = 0; j <= m; j++) { dp[0][j] = 1; // printf("dp[0][%d] is %d\n", j, dp[0][j]); } for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++){ dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; // printf("dp[%d][%d] is %d\n", i, j, dp[i][j]); } } printf("%d\n", dp[n][m]); } return 0; }