import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    }

} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    }

} Main public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader((System.in))); br new BufferedReader(new InputStreamReader((System.in))) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int n = Integer.parseInt(st.nextToken()); n Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int m = Integer.parseInt(st.nextToken()); m Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int total = 0; total 0 if (n > 1) {
            total += (n * (n-1) / 2);
        } n > 1 n 1 {
            total += (n * (n-1) / 2);
        } total += (n * (n-1) / 2) total (n * (n-1) / 2) n * (n-1) n (n-1) n 1 2 if (m > 1) {
            total += (m * (m-1) / 2);
        } m > 1 m 1 {
            total += (m * (m-1) / 2);
        } total += (m * (m-1) / 2) total (m * (m-1) / 2) m * (m-1) m (m-1) m 1 2 System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    }

} public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    }

} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int total = 0;
        if (n > 1) {
            total += (n * (n-1) / 2);
        }
        if (m > 1) {
            total += (m * (m-1) / 2);
        }
        System.out.println(total);
//        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
//        bw.write("\n");
//        bw.close();
    }

}