#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int app_cut = n * 3;
  int app_shim = app_cut / 2;
  int app_shim_rem = app_cut % 2;
  int shim_m = m / 2;
  int rem_m = m % 2;
  cout << (shim_m + rem_m + app_shim + app_shim_rem) - 1;
}
