#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
constexpr int INF = 100000000;
constexpr long long LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;
long long N, X;
void init() {}
void solve() {
  double ans;
  ans = 3 * N - 1.5 * X;
  cout << static_cast<long long>(ans) << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> X;
  solve();
  return 0;
}
