import std.conv, std.stdio;
import std.algorithm, std.array, std.string, std.range;
void main()
{
    auto buf = readln.chomp.split.to!(int[]);
    (buf[0].c2 + buf[1].c2).writeln;
}
auto c2(in int n)
{
    return n * (n - 1) / 2;
}
