//A320. Вложенный цикл
import java.util.*;
import java.lang.*;
import java.io.*;
class ThirdAndHalfLab
{
public static void main
(String[] args
) {
Scanner input
= new Scanner
(System.
in); int n, m, k, l;
n = input.nextInt();
m = input.nextInt();
long m_sum = 0, n_sum = 0;
for(k = 1; k <= n; k++)
{
for(l = 1; l <= m; l++)
{
m_sum += (k-l)*(k-l);
}
n_sum += k*k*k * m_sum;
m_sum -= m_sum;
}
}
}
Ly9BMzIwLiDQktC70L7QttC10L3QvdGL0Lkg0YbQuNC60LsKCmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKY2xhc3MgVGhpcmRBbmRIYWxmTGFiCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKQoJewoJCVNjYW5uZXIgaW5wdXQgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWludCBuLCBtLCBrLCBsOwoJCW4gPSBpbnB1dC5uZXh0SW50KCk7CgkJbSA9IGlucHV0Lm5leHRJbnQoKTsKCQlsb25nIG1fc3VtID0gMCwgbl9zdW0gPSAwOwoJCQoJCWZvcihrID0gMTsgayA8PSBuOyBrKyspCgkJewoJCQlmb3IobCA9IDE7IGwgPD0gbTsgbCsrKQoJCQl7CgkJCQltX3N1bSArPSAoay1sKSooay1sKTsKCQkJfQoJCQluX3N1bSArPSBrKmsqayAqIG1fc3VtOwoJCQltX3N1bSAtPSBtX3N1bTsJCQoJCX0KCQlTeXN0ZW0ub3V0LnByaW50bG4obl9zdW0pOwoJfQp9