import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm; void main() { auto L = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 1.iota(13) .map!(X => 1.iota(L[X-1]+1) .map!(Y => X==Y/10+Y%10?1:0).sum) .sum .writeln; }