#include <bits/stdc++.h>
using namespace std;
int n, m, ans, l[210];
inline int read(int &xx) {
  xx = 0;
  int f = 0;
  char ch = getchar();
  for (; !isdigit(ch); f |= ch == '-', ch = getchar())
    ;
  for (; isdigit(ch); xx = (xx << 1) + (xx << 3) + ch - '0', ch = getchar())
    ;
  xx = f ? -xx : xx;
}
void print1(int xx) {
  if (xx >= 10) print1(xx / 10);
  putchar(xx % 10 + '0');
}
inline void print(int xx) {
  if (xx < 0) {
    putchar('-');
    xx = -xx;
  }
  print1(xx);
  putchar('\n');
}
int main() {
  read(n);
  read(m);
  print((n - 1) * 3);
  return 0;
}
