Scanf.scanf "%d/%d/%d" (fun y m d -> let isleap y = y mod 400 = 0 || (y mod 100 <> 0 && y mod 4 = 0) in let days y m = if isleap y then [| 31; 29; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31 |].(m - 1) else [| 31; 28; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31 |].(m - 1) in let d = d + 2 in let m, d = if d > days y m then m + 1, d - days y m else m, d in let y, m = if m > 12 then y + 1, m - 12 else y, m in Printf.printf "%04d/%02d/%02d\n" y m d )