#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#ifdef DEBUG
static int n;
bool smaller (int x) {
    if (n<x) return true;
    return false;
}
#else
#include "guess.h"
#endif
int find_number(int MAX)
{
    int mini = 1, maxi = MAX;
    while (mini < maxi)
    {
        int mean = (mini+maxi+1)/2;
        if (smaller(mean))
        {
            maxi = mean-1;
        }
        else
        {
            mini = mean;
        }
    }
    return mini;
}
#ifdef DEBUG
int main () {
    int MAX,res;
    cin >> MAX >> n ;
    res=find_number(MAX);
    cout << res ;
    cout << endl ;
    return 0;
}
#endif
