import sys

input = sys.stdin.readline


def main():
    A, P = map(int, input().split())
    q, _ = divmod(3 * A + P, 2)
    print(q)


if __name__ == "__main__":
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    A, P = map(int, input().split())
    q, _ = divmod(3 * A + P, 2)
    print(q) main A, P = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split P q, _ = divmod(3 * A + P, 2) q divmod(3 * A + P, 2) divmod 3 * A + P 3 * A 3 A P 2 _ print(q) print q if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    A, P = map(int, input().split())
    q, _ = divmod(3 * A + P, 2)
    print(q) def main():
    A, P = map(int, input().split())
    q, _ = divmod(3 * A + P, 2)
    print(q) main input = sys.stdin.readline sys.stdin.readline input
import sys

input = sys.stdin.readline


def main():
    A, P = map(int, input().split())
    q, _ = divmod(3 * A + P, 2)
    print(q)


if __name__ == "__main__":
    main()
