int main(){ int m,d; scanf("%d%d",&m,&d); if(m==4&&d==1){printf("9999\n");} else{printf("%d\n",m+d);} return 0; }