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 [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} 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 [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    } 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 [] nums = new int[n+m]; nums new int[n+m] n+m n m int i = 0; i 0 while (i<n){
            nums[i] = 2;
            i++;
        } i<n i n {
            nums[i] = 2;
            i++;
        } nums[i] = 2 nums[i] nums i 2 i++ i while (i<n+m){
            nums[i] = 1;
            i++;
        } i<n+m i n+m n m {
            nums[i] = 1;
            i++;
        } nums[i] = 1 nums[i] nums i 1 i++ i int count = 0; count 0 for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        } int j = 0; int j = 0; j 0 j<nums.length j nums.length nums nums.length j++ j++ j {
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        } {
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        } for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            } int k = j+1; int k = j+1; k j+1 j 1 k<nums.length k nums.length nums nums.length k++ k++ k {
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            } {
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            } if((nums[j]+nums[k])%2 == 0){
                    count++;
                } (nums[j]+nums[k])%2 == 0 (nums[j]+nums[k])%2 (nums[j]+nums[k]) nums[j] nums j nums[k] nums k 2 0 {
                    count++;
                } count++ count System.out.println(count) System.out.println System.out System System.out count 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 [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
} 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 [] nums = new int[n+m];
        int i = 0;
        while (i<n){
            nums[i] = 2;
            i++;
        }
        while (i<n+m){
            nums[i] = 1;
            i++;
        }
        int count = 0;
        for(int j = 0; j<nums.length; j++){
            for(int k = j+1; k<nums.length; k++){
                if((nums[j]+nums[k])%2 == 0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}