package main import . "fmt" func main() { var n int Scan(&n) b:=make([]int,n) for _=range b { for i:=range b { var a string Scan(&a) if a=="nyanpass" { b[i]=1 } } } c:=0 k:=0 for i,v:=range b { c+=v k+=(i+1)*v } if c!=1 { Println(-1) return } Println(k) }