#include<iostream> #include <cstdlib> using namespace std; int main(){ int n,m;cin >>n>>m; int r = rand()%2; if(m==1) cout<<0; else cout<<m-1; }