#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
long long s = 0, s1=0;
void kovr(long long n, long long m) 
{
	long long b = n;
	long long a = m;
	while (n > 1) {
		s += m * n;
		n--;
	}
	while (m > 1) {
		s1 += m;
		m--;
	}
	s1 += a;
	s += s1 * b;
}

int main() {
	long long n, m;
	cin >> n >> m;
	kovr(n, m);
	cout << s;
}