#include <bits/stdc++.h>
using namespace std;
template <typename X>
inline X abs(const X& a) {
  return a < 0 ? -a : a;
}
template <typename X>
inline X sqr(const X& a) {
  return a * a;
}
const int INF = int(1e9);
const long long INF64 = long long(1e18);
const long double EPS = 1e-9;
const long double PI = acosl(long double(-1));
long long n, first;
inline bool read() {
  if (!(cin >> n >> first)) return false;
  return true;
}
inline void solve() { cout << 3 * (n - 1) << endl; }
int main() {
  cout << setprecision(25) << fixed;
  cerr << setprecision(10) << fixed;
  srand(int(time(NULL)));
  assert(read());
  solve();
  return 0;
}
