import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
} Main public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    } main {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int evenNum = sc.nextInt(); evenNum sc.nextInt() sc.nextInt sc int oddNum = sc.nextInt(); oddNum sc.nextInt() sc.nextInt sc int resultNum = 0; resultNum 0 if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        } 1 < evenNum 1 evenNum {
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        } for(int i = 1; i < evenNum; i++){
                resultNum += i;
            } int i = 1; int i = 1; i 1 i < evenNum i evenNum i++ i++ i {
                resultNum += i;
            } {
                resultNum += i;
            } resultNum += i resultNum i if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        } 1 < oddNum 1 oddNum {
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        } for(int i = 1; i < oddNum; i++){
                resultNum += i;
            } int i = 1; int i = 1; i 1 i < oddNum i oddNum i++ i++ i {
                resultNum += i;
            } {
                resultNum += i;
            } resultNum += i resultNum i System.out.println(resultNum) System.out.println System.out System System.out resultNum String[] args args public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
} public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
}
