import java.util.*;
 
public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
} Main public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    } main {
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int m = stdIn.nextInt(); m stdIn.nextInt() stdIn.nextInt stdIn int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        } n > 1 n 1 {
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        } for(int i = n - 1; i > 0; i--){
                sum1 += i;
            } int i = n - 1; int i = n - 1; i n - 1 n 1 i > 0 i 0 i-- i-- i {
                sum1 += i;
            } {
                sum1 += i;
            } sum1 += i sum1 i if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        } m > 1 m 1 {
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        } for(int i = m - 1; i > 0; i--){
                sum2 += i;
            } int i = m - 1; int i = m - 1; i m - 1 m 1 i > 0 i 0 i-- i-- i {
                sum2 += i;
            } {
                sum2 += i;
            } sum2 += i sum2 i int sum = sum1 + sum2; sum sum1 + sum2 sum1 sum2 System.out.println(sum) System.out.println System.out System System.out sum stdIn.close() stdIn.close stdIn String args[] args public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
} public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        
        int sum1 = 0;
        int sum2 = 0;
        
        if(n > 1){
            for(int i = n - 1; i > 0; i--){
                sum1 += i;
            }
        }
        
        if(m > 1){
            for(int i = m - 1; i > 0; i--){
                sum2 += i;
            }
        }
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        int sum = sum1 + sum2;
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(sum);
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
}