import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();

        //箱を作る
        int[] box = new int[N+M];
        //箱の中にNとMを入れる
        for (int i =0; i < N; i++) {
            box[i] = 2;
        }
        for (int i = N; i < box.length; i++) {
            box[i] = 1;
        }

        int count = 0;
        for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();

        //箱を作る
        int[] box = new int[N+M];
        //箱の中にNとMを入れる
        for (int i =0; i < N; i++) {
            box[i] = 2;
        }
        for (int i = N; i < box.length; i++) {
            box[i] = 1;
        }

        int count = 0;
        for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();

        //箱を作る
        int[] box = new int[N+M];
        //箱の中にNとMを入れる
        for (int i =0; i < N; i++) {
            box[i] = 2;
        }
        for (int i = N; i < box.length; i++) {
            box[i] = 1;
        }

        int count = 0;
        for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();

        //箱を作る
        int[] box = new int[N+M];
        //箱の中にNとMを入れる
        for (int i =0; i < N; i++) {
            box[i] = 2;
        }
        for (int i = N; i < box.length; i++) {
            box[i] = 1;
        }

        int count = 0;
        for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N N M; M N = sc.nextInt() N sc.nextInt() sc.nextInt sc M = sc.nextInt() M sc.nextInt() sc.nextInt sc int[] box = new int[N+M]; box new int[N+M] N+M N M for (int i =0; i < N; i++) {
            box[i] = 2;
        } int i =0; int i =0; i 0 i < N i N i++ i++ i {
            box[i] = 2;
        } {
            box[i] = 2;
        } box[i] = 2 box[i] box i 2 for (int i = N; i < box.length; i++) {
            box[i] = 1;
        } int i = N; int i = N; i N i < box.length i box.length box box.length i++ i++ i {
            box[i] = 1;
        } {
            box[i] = 1;
        } box[i] = 1 box[i] box i 1 int count = 0; count 0 for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        } int i = 0; int i = 0; i 0 i < box.length i box.length box box.length i++ i++ i {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        } {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        } for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            } int j = i+1; int j = i+1; j i+1 i 1 j < box.length j box.length box box.length j++ j++ j {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            } {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            } if ((box[i]+box[j]) % 2 == 0)
                    count++; (box[i]+box[j]) % 2 == 0 (box[i]+box[j]) % 2 (box[i]+box[j]) box[i] box i box[j] box j 2 0 count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();

        //箱を作る
        int[] box = new int[N+M];
        //箱の中にNとMを入れる
        for (int i =0; i < N; i++) {
            box[i] = 2;
        }
        for (int i = N; i < box.length; i++) {
            box[i] = 1;
        }

        int count = 0;
        for (int i = 0; i < box.length; i++) {
            for (int j = i+1; j < box.length; j++) {
                if ((box[i]+box[j]) % 2 == 0)
                    count++;
            }
        }
        System.out.println(count);
    }
}