import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    }

    public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    }

    public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int evenBalls = sc.nextInt(); evenBalls sc.nextInt() sc.nextInt sc int oddBalls = sc.nextInt(); oddBalls sc.nextInt() sc.nextInt sc int result = execute(evenBalls,oddBalls); result execute(evenBalls,oddBalls) execute evenBalls oddBalls System.out.println(result) System.out.println System.out System System.out result String[] args args public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    } execute {
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    } return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2; evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2 evenBalls*(evenBalls - 1)/2 evenBalls*(evenBalls - 1) evenBalls (evenBalls - 1) evenBalls 1 2 oddBalls*(oddBalls - 1)/2 oddBalls*(oddBalls - 1) oddBalls (oddBalls - 1) oddBalls 1 2 int evenBalls evenBalls int oddBalls oddBalls public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    }

    public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    }

    public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int evenBalls = sc.nextInt();
        int oddBalls = sc.nextInt();
	    int result = execute(evenBalls,oddBalls);
        System.out.println(result);
    }

    public static int execute(int evenBalls, int oddBalls){
        //偶数と偶数、奇数と奇数でのみ組み合わせ
        return evenBalls*(evenBalls - 1)/2
                +oddBalls*(oddBalls - 1)/2;
    }
}