#include int main() { int a,b,step; scanf("%d %d",&a,&b); if (b % a) step = b % a +1; else step = b % a; printf("%d\n",step); return 0; }