#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, X;
  scanf("%d %d", &N, &X);
  int length = 0;
  for (int i = 1; i < N; i++) {
    length += 3;
  }
  printf("%d\n", length);
  return 0;
}
