while 1:s=map(int,raw_input().split());print(s[0]-1)*s[1]-s[0]