#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7,
          around[] = {0, 1, 1, -1, -1, 0, -1, 1, 0, 0};
const long long LINF = 1e18;
const long double PI = abs(acos(-1));
long long n, x;
int main() {
  cin >> n >> x;
  cout << n + 3 * x + 1 << endl;
  return 0;
}
