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 n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            }
} 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 n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            }
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        
        int n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            } main {
    
    Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        
        int n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            } 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 n = 0; n 0 for(int i=1; i<=N-1; i++){
            n += i;
} int i=1; int i=1; i 1 i<=N-1 i N-1 N 1 i++ i++ i {
            n += i;
} {
            n += i;
} n += i n i int m = 0; m 0 for(int i=1; i<=M-1; i++){
            m += i;
} int i=1; int i=1; i 1 i<=M-1 i M-1 M 1 i++ i++ i {
            m += i;
} {
            m += i;
} m += i m i System.out.println(n+m) System.out.println System.out System System.out n+m n m 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 n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            }
} public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        
        int n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            }
} 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 n = 0;
        for(int i=1; i<=N-1; i++){
            n += i;
}
        int m = 0;
        for(int i=1; i<=M-1; i++){
            m += i;
}
                System.out.println(n+m);            
            }
}