import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n_even = Integer.parseInt(sc.next()); n_even Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m_odd = Integer.parseInt(sc.next()); m_odd Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int n_even_count = (n_even * (n_even - 1)) / 2; n_even_count (n_even * (n_even - 1)) / 2 (n_even * (n_even - 1)) n_even (n_even - 1) n_even 1 2 int m_odd_count = (m_odd * (m_odd - 1)) / 2; m_odd_count (m_odd * (m_odd - 1)) / 2 (m_odd * (m_odd - 1)) m_odd (m_odd - 1) m_odd 1 2 int answer = n_even_count + m_odd_count; answer n_even_count + m_odd_count n_even_count m_odd_count System.out.println(answer) System.out.println System.out System System.out answer sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n_even = Integer.parseInt(sc.next()); // 偶数が書かれている
        int m_odd = Integer.parseInt(sc.next()); // 奇数が書かれている
        // 偶数同士または奇数同士の和が偶数になる
        int n_even_count = (n_even * (n_even - 1)) / 2;
        int m_odd_count = (m_odd * (m_odd - 1)) / 2;
        int answer = n_even_count + m_odd_count;
        System.out.println(answer);
        sc.close();
    }
}