my $cnt = 0; loop (my $date = Date.new(2015, 1, 1); $date.year() == 2015; $date++){ my $day = $date.day(); $cnt++ if $date.month() == $day div 10 + $day % 10; } say $cnt;