error("Input error.") if ($input !~ /(.+?\(\d+\):?.+?\(\d+\))+/);