#include <bits/stdc++.h>
using namespace std;
const int maxn = 205;
inline int gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
int n, L[maxn];
int main() {
  long long n, x;
  scanf("%lld%lld", &n, &x);
  printf("%lld\n", 2 * n + x);
  return 0;
}
