// No.1183 コイン遊び package main import ( "bufio" "fmt" "os" "strconv" ) const NMAX = 1_000_000 func main() { sc := bufio.NewScanner(os.Stdin) sc.Buffer(make([]byte, NMAX*2+2), NMAX*2+2) sc.Scan() N, _ := strconv.Atoi(sc.Text()) sc.Scan() A := sc.Text() sc.Scan() B := sc.Text() diff0, count := false, 0 for i := 0; i < N; i++ { diff := A[2*i] != B[2*i] if diff && !diff0 { count++ } diff0 = diff } fmt.Println(count) }