import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { static public void main(String[]args) throws Exception { Scanner sc = new Scanner(System.in); String n = sc.next(); printAns(n); } static void printAns(String s) throws Exception { if( isValid(s) ) { int ans = s.length() -1; System.out.println(ans); } else { System.out.println(-1); } } static boolean isValid(String s) throws Exception { List list = new ArrayList<>(); for(int i=0; i