import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    } 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 int mp = 0; mp 0 if (n > 1) {
            np = n*(n-1)/2;
        } n > 1 n 1 {
            np = n*(n-1)/2;
        } np = n*(n-1)/2 np n*(n-1)/2 n*(n-1) n (n-1) n 1 2 if (m > 1) {
            mp = m*(m-1)/2;
        } m > 1 m 1 {
            mp = m*(m-1)/2;
        } mp = m*(m-1)/2 mp m*(m-1)/2 m*(m-1) m (m-1) m 1 2 System.out.println(np+mp) System.out.println System.out System System.out np+mp np mp 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();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //奇数２つパターン
        //偶数２つパターン
        int np = 0;
        int mp = 0;
        if (n > 1) {
            np = n*(n-1)/2;
        }
        if (m > 1) {
            mp = m*(m-1)/2;
        }
        System.out.println(np+mp);
    }
}