import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    } main {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    } 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 long ans = 0; ans 0 if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        } n > 1 n 1 {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        } int ans1 = 0; ans1 0 for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            } int i = n - 1; int i = n - 1; i n - 1 n 1 i > 0 i 0 i-- i-- i {
                ans1 += i;
            } {
                ans1 += i;
            } ans1 += i ans1 i ans += ans1 ans ans1 if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        } m > 1 m 1 {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        } int ans2 = 0; ans2 0 for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            } int i = m - 1; int i = m - 1; i m - 1 m 1 i > 0 i 0 i-- i-- i {
                ans2 += i;
            } {
                ans2 += i;
            } ans2 += i ans2 i ans += ans2 ans ans2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // ABC159A - The Number of Even Pairs

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();

        long ans = 0;
        if (n > 1) {
            int ans1 = 0;
            for (int i = n - 1; i > 0 ; i--) {
                ans1 += i;
            }
            ans += ans1;
        }
        if (m > 1) {
            int ans2 = 0;
            for (int i = m - 1; i > 0 ; i--) {
                ans2 += i;
            }
            ans += ans2;
        }

        System.out.println(ans);
    }
}
