let ans s =
  let n = String.length s in
  let g (a, b) = if s.[n-2] == s.[n-1] then (n-1, a+1) else (a, b) in
  let rec f i =
    if i = n-2 then (-1, -1)
    else if s.[i] = s.[i+1] then (i+1, i+2)
    else if s.[i] = s.[i+2] then (i+1, i+3)
    else f (i+1)
  in g (f 0)

let print_ans (a, b) =
  begin
    print_int a;
    print_string " ";
    print_int b
  end

let solve s = print_ans (ans s);;

Scanf.scanf "%s" (fun s -> solve s)
