#include <stdio.h>
int main(void) {
    int u, v;
    int total_apple, ans;

    scanf("%d, %d", &a, &p);

    total_apple = 3 * a + p;
    ans = total_apple / 3;

    printf("%d", ans);

    return 0;
}
