using System;
using System.Linq;
public class Test
{
public static void Main()
{
var freq = 0;
for(var first = 100; first <= 999; ++first)
{
var firstSum = first.ToString().Select(x => Convert.ToInt32(x - '0')).ToArray<int>().Sum();
for(var second = 000; second <= 999; ++second)
{
var secondSum = second.ToString().Select(x => Convert.ToInt32(x - '0')).ToArray<int>().Sum();
if (firstSum == secondSum) ++freq;
}
}
Console.WriteLine(freq);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uTGlucTsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQl2YXIgZnJlcSA9IDA7CiAgICAgICAgICAgIGZvcih2YXIgZmlyc3QgPSAxMDA7IGZpcnN0IDw9IDk5OTsgKytmaXJzdCkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdmFyIGZpcnN0U3VtID0gZmlyc3QuVG9TdHJpbmcoKS5TZWxlY3QoeCA9PiBDb252ZXJ0LlRvSW50MzIoeCAtICcwJykpLlRvQXJyYXk8aW50PigpLlN1bSgpOwogICAgICAgICAgICAgICAgZm9yKHZhciBzZWNvbmQgPSAwMDA7IHNlY29uZCA8PSA5OTk7ICsrc2Vjb25kKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIHZhciBzZWNvbmRTdW0gPSBzZWNvbmQuVG9TdHJpbmcoKS5TZWxlY3QoeCA9PiBDb252ZXJ0LlRvSW50MzIoeCAtICcwJykpLlRvQXJyYXk8aW50PigpLlN1bSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdFN1bSA9PSBzZWNvbmRTdW0pICsrZnJlcTsKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZShmcmVxKTsgICAgCgl9Cn0=