import java.util.Scanner;

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

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int sumn = 0; sumn 0 int i; i for (i = 0; i < n; i++ ){
            sumn += i;
        } i = 0; i = 0 i 0 i < n i n i++ i++ i {
            sumn += i;
        } {
            sumn += i;
        } sumn += i sumn i int summ = 0; summ 0 int j; j for (j = 0; j < m; j++){
            summ += j;
        } j = 0; j = 0 j 0 j < m j m j++ j++ j {
            summ += j;
        } {
            summ += j;
        } summ += j summ j System.out.println(sumn + summ) System.out.println System.out System System.out sumn + summ sumn summ String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    }
} Main
import java.util.Scanner;

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

        int sumn = 0;
        int i;
        for (i = 0; i < n; i++ ){
            sumn += i;
        }

        int summ = 0;
        int j;
        for (j = 0; j < m; j++){
            summ += j;
        }
        System.out.println(sumn + summ);
    }
}