#include <bits/stdc++.h>
int main() {
  int A, P;
  scanf("%d%d", &A, &P);
  while (0 <= A, P <= 100) {
    if (A + P > 2) {
      printf("%d", (A * 3 + P) / 2);
      break;
    } else {
      printf("0");
      break;
    }
  }
}
