#include <bits/stdc++.h>
using namespace std;
int main() {
std:
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long N, X;
  cin >> N >> X;
  int sum = 0, currL;
  sum += N;
  sum += 2 * (N - 1) - 1;
  cout << sum;
  return 0;
}
