package main import . "fmt" func main() { var n string Scan(&n) m:=map[rune]int{} for _,c:=range n { m[c]++ } if len(m)==2&&n[0]=='1'&&m['1']==1&&m['3']>0 { Println(m['3']) } else { Println(-1) } }