#include"stdio.h" main(i){int x,y;while(scanf("%d %d",&x,&y)&&i++<301)printf("%d\n",(x-1)*y-x);}