#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int N = 200010;
const int mod = 1000000007LL;
int main() {
  long long n, x;
  scanf("%lld %lld", &n, &x);
  printf("%lld\n", (n - 1) * 3);
  return 0;
}
