#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T>& operator--(vector<T>& v) {
  for (auto& i : v) --i;
  return v;
}
template <typename T>
vector<T>& operator++(vector<T>& v) {
  for (auto& i : v) ++i;
  return v;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& i : v) os << i << ' ';
  return os;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <typename T, typename U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <typename T, typename U>
void umin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void umax(T& a, U b) {
  if (a < b) a = b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  if (k == 1) {
    cout << 1 << '\n';
    return 0;
  }
  if (k == 2) {
    cout << n << '\n';
    return 0;
  }
  k -= 2;
  long long l = -1, r = n + 10;
  while (r - l > 1) {
    long long c = (l + r) / 2;
    map<long long, long long> m;
    function<long long(long long, long long)> count = [&](long long l,
                                                          long long r) {
      if (l + 1 >= r) return 0ll;
      if (m.count(r - l)) return m[r - l];
      long long mid = (l + r) / 2;
      if (abs(mid - l) < c) return 0ll;
      return m[r - l] = count(l, mid) + count(mid, r) + 1;
    };
    auto cnt = count(1, n);
    if (cnt < k)
      r = c;
    else
      l = c;
  }
  long long d = l;
  42;
  ;
  map<pair<long long, long long>, long long> m;
  function<long long(long long, long long, long long)> count =
      [&](long long l, long long r, long long d) {
        if (l + 1 >= r) return 0ll;
        if (m.count({r - l, d})) return m[{r - l, d}];
        long long mid = (l + r) / 2;
        if (abs(mid - l) < d) return 0ll;
        return m[{r - l, d}] = count(l, mid, d) + count(mid, r, d) + 1;
      };
  map<long long, long long> m2;
  function<long long(long long, long long)> count2 = [&](long long l,
                                                         long long r) {
    if (l + 1 >= r) return 0ll;
    if (m2.count(r - l)) return m2[r - l];
    long long mid = (l + r) / 2;
    if (abs(mid - l) < d) return 0ll;
    return m2[r - l] = count2(l, mid) + count2(mid, r) + (mid - l == d);
  };
  k -= count(1, n, d + 1);
  function<long long(long long, long long, long long)> get_ans =
      [&](long long l, long long r, long long k) {
        42;
        ;
        long long mid = (l + r) / 2;
        k -= (mid - l == d);
        if (k == 0) return mid;
        long long cnt = count2(l, mid);
        42;
        ;
        if (cnt >= k)
          return get_ans(l, mid, k);
        else
          return get_ans(mid, r, k - cnt);
      };
  cout << get_ans(1, n, k) << '\n';
  return 0;
}
