import java.util.*;
import javax.lang.model.util.ElementScanner6;
import java.lang.Math;

public class Main {

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

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    }
} import java.util.*; util.* java import javax.lang.model.util.ElementScanner6; ElementScanner6 javax.lang.model.util import java.lang.Math; Math java.lang public class Main {

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

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    } main {
        Scanner sc = new Scanner(System.in);

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int np = 0; np 0 if ( n >= 2){
            np = n * (n - 1) / 2;
        } n >= 2 n 2 {
            np = n * (n - 1) / 2;
        } np = n * (n - 1) / 2 np n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 int mp = 0; mp 0 if ( m >= 2){
            mp = m * (m - 1) / 2;
        } m >= 2 m 2 {
            mp = m * (m - 1) / 2;
        } mp = m * (m - 1) / 2 mp m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 int out = np + mp; out np + mp np mp System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main {

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

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    }
} public class Main {

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

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    }
} Main
import java.util.*;
import javax.lang.model.util.ElementScanner6;
import java.lang.Math;

public class Main {

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

        // 入力
        int n = sc.nextInt();
        int m = sc.nextInt();

        // 処理
        //n
        int np = 0;
        if ( n >= 2){
            np = n * (n - 1) / 2;
        }
        //m
        int mp = 0;
        if ( m >= 2){
            mp = m * (m - 1) / 2;
        }

        int out = np + mp;

        // 出力
        System.out.println(out);
    }
}