#include <bits/stdc++.h>
#pragma GCC optimize(2)
const long long N = 2e3 + 10;
const long long mod = 1e9 + 7;
const long long inf = 0x3f3f3f3f;
using namespace std;
template <typename tp>
inline void read(tp &x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  for (; c < '0' || c > '9'; f |= (c == '-'), c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar())
    ;
  if (f) x = -x;
}
long long n, x;
signed main() {
  read(n), read(x);
  printf("%lld\n", 1LL * x + n * 2);
  return 0;
}
