/* eslint no-console: "off" */ function div_ceil(a, b) { return Math.trunc(a/b) + ((((a<0)^(b>0)) && a%b) ? 1 : 0); } function div_floor(a, b) { return Math.trunc(a/b) + ((((a>0)^(b>0)) && a%b) ? 1 : 0); } const DOMS = [ -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, ]; function digit_sum(n) { let res = 0; while(n > 0) { res += n % 10; n = div_floor(n, 10); } return res; } function is_ok(m, d) { return m == digit_sum(d); } function Main(input) { let ans = 0; for(let m = 1; m <= 12; ++m) { let dom = DOMS[m]; for(let d = 1; d <= dom; ++d) { if(is_ok(m,d)) ++ans; } } console.log(ans); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));