#include <iostream>
#include <cassert>

size_t CalculateCoverage(size_t n, size_t m) {
    if (m < n) {
        std::swap(n, m);
    }
    // assert(n <= m)
    if (n == 1) {
        return m * (m + 1) / 2 + (m - 1);
    }
    return n * m + CalculateCoverage(n, m - 1) + CalculateCoverage(n, 1);
}


int main() {
    size_t n, m;
    std::cin >> n >> m;
    std::cout << CalculateCoverage(n, m);

    // assert(CalculateCoverage(1, 2) == 4);
    // assert(CalculateCoverage(2, 1) == 4);
    // assert(CalculateCoverage(1, 5) == 19);
    // assert(CalculateCoverage(5, 1) == 19);

    // assert(CalculateCoverage(2, 2) == 12);
    // assert(CalculateCoverage(3, 2) == 22);
}