import Data.List

solver::String->String->String->Int
solver [] _ _ = 0
solver (x:xs) (y:ys) (z:zs) = ((length.group.sort) [x,y,z])-1 + (solver xs ys zs)

main::IO()
main=do
  _<-getLine
  a<-getLine
  b<-getLine
  c<-getLine
  print (solver a b c)
