#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ret = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * f;
}
int main(int argc, char* argv[]) {
  unsigned long long ullNumber;
  unsigned long long ullNumberX;
  cin >> ullNumber >> ullNumberX;
  cout << 3 * (ullNumber - 1) << endl;
  return 0;
}
