#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, p;
  cin >> a >> p;
  if (a % 2 == 0) {
    cout << a + 1 + p / 2 << endl;
  } else {
    p++;
    cout << a + 1 + p / 2 << endl;
  }
  return 0;
}
