#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ddx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
bool debug = false;
int main() {
  int N, M;
  long long sum = 0;
  cin >> N >> M;
  srand((unsigned int)time(NULL));
  cout << rand() % (M + 1) << endl;
  return 0;
}
