#include <bits/stdc++.h>

using namespace std;

bool smaller(int x);

int find_number(int MAX) {
    int l = 1, r = MAX + 1;
    while (r - l > 1) {
        int k = (l + r) / 2;
        if (smaller(k)) r = k;
        else l = k;
    }
    return l;
}

#ifdef LOCAL
static int n;
bool smaller (int x) {
    if (n<x) return true;
    return false;
}
extern int find_number (int);
int main () {
    int MAX,res;
    cin >> MAX >> n ;
    res=find_number(MAX);
    cout << res ;
    cout << endl ;
    return 0;
}
#endif
