import java.util.Scanner;

public class Main {

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

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    } main {
        final Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc final int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 0; i < N; i++) ans += i; int i = 0; int i = 0; i 0 i < N i N i++ i++ i ans += i; ans += i ans i for (int i = 0; i < M; i++) ans += i; int i = 0; int i = 0; i 0 i < M i M i++ i++ i ans += i; ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

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

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    }
} public class Main {

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

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

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

        final int N = sc.nextInt();
        final int M = sc.nextInt();

        int ans = 0;
        for (int i = 0; i < N; i++) ans += i;
        for (int i = 0; i < M; i++) ans += i;
        
        System.out.println(ans);
    }
}
