#include <bits/stdc++.h>
using namespace std;
inline long long gi() {
  long long f = 1, sum = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = (sum << 3) + (sum << 1) + ch - '0';
    ch = getchar();
  }
  return f * sum;
}
long long n, x;
int main() {
  n = gi();
  x = gi();
  printf("%lld\n", n * 2 + x);
  return 0;
}
