($y,$n,$d)=glob<>; $z=$y-13; $a=365+(($y%100==0?$y/100:$y)%4==0); $b=365+(($z%100==0?$z/100:$z)%4==0); if($a==$b){ $-=$n-$d; $c=$a-$d; } if($a<$b){ $-=$n-$d-($d>=59); $c=$b-$d-($d>=59); } if($a>$b){ $-=$n-$d+($d>=59); $c=$b-$d+($d>=59); } print $-, $", $n<=$c?$n:$c;