#include <bits/stdc++.h>
int main(void) {
  int A = 0;
  int P = 0;
  int Maxpie = 0;
  int piece = 0;
  int pie = 0;
  printf("A:");
  scanf("%d", &A);
  printf("P:");
  scanf("%d", &P);
  piece = A * 3.0 + P;
  if (piece % 2 == 0) {
    Maxpie = piece / 2;
  } else if (piece % 2 == 1) {
    Maxpie = (piece - 1) / 2;
  }
  printf("%d", Maxpie);
  return 0;
}
