import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    }
} Main public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    } main {
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n n m m tmpN tmpN tmpM; tmpM n=scan.nextInt() n scan.nextInt() scan.nextInt scan m=scan.nextInt() m scan.nextInt() scan.nextInt scan tmpM=0 tmpM 0 tmpN=0 tmpN 0 for(int i=1;i<n;i++){
            tmpN +=i;
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
            tmpN +=i;
        } {
            tmpN +=i;
        } tmpN +=i tmpN i for(int i=1;i<m;i++){
            tmpM += i;
        } int i=1; int i=1; i 1 i<m i m i++ i++ i {
            tmpM += i;
        } {
            tmpM += i;
        } tmpM += i tmpM i System.out.println(tmpM+tmpN) System.out.println System.out System System.out tmpM+tmpN tmpM tmpN String[]args args public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    }
} public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int n,m,tmpN,tmpM;
        n=scan.nextInt();
        m=scan.nextInt();
        tmpM=0;
        tmpN=0;
        for(int i=1;i<n;i++){
            tmpN +=i;
        }
        for(int i=1;i<m;i++){
            tmpM += i;
        }
        System.out.println(tmpM+tmpN);
    }
}