import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    } main {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner System.out.println(((a * (a-1))/2 + (b * (b-1))/2)) System.out.println System.out System System.out ((a * (a-1))/2 + (b * (b-1))/2) (a * (a-1))/2 (a * (a-1)) a (a-1) a 1 2 (b * (b-1))/2 (b * (b-1)) b (b-1) b 1 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    }

} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        System.out.println(((a * (a-1))/2 + (b * (b-1))/2));
    }

}