import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int h = scanner.nextInt();
        int w = scanner.nextInt();

        if (w < h) {
            int temp = w;
            w = h;
            h = temp;
        }
        long result = (long) h * ((w + 1L) * w / 2L + w - 1) + (h + 1L) * h / 2 * w - w;
        System.out.println(result);
    }
}
