import java.util.*;

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

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }

        System.out.println(even+odd);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }

        System.out.println(even+odd);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }

        System.out.println(even+odd);
    } main {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }

        System.out.println(even+odd);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int even = 0; even 0 int odd = 0; odd 0 for (int i = 0; i < n ; i++) {
            even += i;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            even += i;
        } {
            even += i;
        } even += i even i for (int i = 0; i < m ; i++) {
            odd += i;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            odd += i;
        } {
            odd += i;
        } odd += i odd i System.out.println(even+odd) System.out.println System.out System System.out even+odd even odd String[] args args
import java.util.*;

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

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }

        System.out.println(even+odd);
    }
}