#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int A, P, ans;
  cin >> A >> P >> ans;
  if (A * 3 % 2 == 0 && P % 2 == 0) ans = (A * 3 + P) / 2;
  cout << ans << endl;
  if (A * 3 % 2 == 1 && P % 2 == 1) {
    ans = (A * 3 + P) / 2;
    cout << ans << endl;
  } else {
    ans = (A * 3 + P) / 2 + 1;
    cout << ans << endl;
  }
  return 0;
}
