package main import . "fmt" import . "strings" func main() { var n,s string Scan(&n,&s) var c int if Contains(s,"BB") { c++ } c+=Count(s,"AA") c+=Count(s,"AB") c+=Count(s,"BA") c-=Count(s,"BAB") Println(c) }