Problem:
 Score : 200 points    Problem Statement You are given three strings A, B and C . Each of these is a string of length N consisting of lowercase English letters.  Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:   Operation: Choose one of the strings A, B and C , and specify an integer i between 1 and N (inclusive). Change the i -th character from the beginning of the chosen string to some other lowercase English letter.   What is the minimum number of operations required to achieve the objective?      Constraints  1 \leq N \leq 100  Each of the strings A, B and C is a string of length N .  Each character in each of the strings A, B and C is a lowercase English letter.         Input Input is given from Standard Input in the following format:  N  A  B  C       Output Print the minimum number of operations required.        Sample Input 1 4
west
east
wait      Sample Output 1 3  In this sample, initially A =  west 、 B =  east 、 C =  wait . We can achieve the objective in the minimum number of operations by performing three operations as follows:   Change the second character in A to a . A is now wast .  Change the first character in B to w . B is now wast .  Change the third character in C to s . C is now wast .        Sample Input 2 9
different
different
different      Sample Output 2 0  If A, B and C are already equal in the beginning, the number of operations required is 0 .       Sample Input 3 7
zenkoku
touitsu
program      Sample Output 3 13

Solution (Python):
import collections
def get_ans(strings, n):
    ans = 0
    for i in range(n):
        counter = collections.defaultdict(int)
        for k in strings:
            counter[k[i]] += 1
        ans += len(strings) - max(counter.values())
    return ans

if __name__ == '__main__':
    n = int(input())
    strings = []
    for _ in range(3):
        strings.append(input())
    print(get_ans(strings, n))

Solution (Python):
N = int(input())
A = input()
A = [x for x in A]
B = input()
B = [x for x in B]
C = input()
C = [x for x in C]

total = 0

for i in range(N):
  if(A[i]==B[i] and A[i]!=C[i]):
      total = total+1
  if(A[i]==C[i] and A[i]!=B[i]):
      total =  total + 1
  if(B[i]==C[i] and A[i]!=B[i]):
      total = total + 1
  if(A[i]==B[i] and A[i]==C[i]):
      total = total
  if(A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]):
      total = total + 2

print(total)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
cnt2 = 0
cnt3 = 0
for i in range(n):
  nsame = len(set([a[i], b[i], c[i]]))
  if nsame == 2:
    cnt2 += 1
  elif nsame == 1:
    cnt3 += 1
ans = 2*n - cnt2 - 2*cnt3
print(ans)

Solution (Python):
import collections
def func(a,b,c):
    g=0
    l=[a,b,c]
    d=collections.Counter(l)
    x=len(d)
    if x==3:
        g=2
    elif x==2:
        g=1
    return g
N=int(input())
A=input()
B=input()
C=input()
count=0
for i in range(N):
    count+=func(A[i],B[i],C[i])
print(count)

Solution (Python):
N = int(input())
l = []
for i in range(3):
    l.append(input())
res = 0
for i in range(len(l[0])):
    s = set()
    for j in range(3):
        s.add(l[j][i])
    if len(s) == 3:
        res += 2
    elif len(s) == 2:
        res += 1
print(res)

Solution (Python):
n=int(input())
a,b,c=list(input() for i in range(3))
ans=0
for i in range(n):
    ans+=len(set([a[i],b[i],c[i]]))-1
print(ans)

Solution (Python):
n=int(input())
a,b,c=list(input() for i in range(3))
ans=0
for i in range(n):
    if a[i]==b[i]:
        if b[i]!=c[i]:
            ans+=1
    elif b[i]!=c[i] and a[i]!=c[i]:
        ans+=2
    else:
        ans+=1
print(ans)

Solution (Python):


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = input()
B = input()
C = input()

cnt = 0
for i in range(N):
    if A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
        cnt += 2
    elif A[i] != B[i] or B[i] != C[i] or C[i] != A[i]:
        cnt += 1
print(cnt)

Solution (Python):
n = int(raw_input())
a = []
for _ in range(3):
  a.append(raw_input())
ans = 0
for i in range(n):
  diff_chars = set()
  for j in range(3):
    diff_chars.add(a[j][i])
  ans += len(diff_chars) - 1
print ans

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())
count = 0

for i in range(n):
	if a[i] != b[i] and b[i] != c[i] and a[i] != c[i]:
		count += 2
	elif a[i] != b[i] and b[i] == c[i] and a[i] != c[i]:
		count += 1
	elif a[i] != b[i] and b[i] != c[i] and a[i] == c[i]:
		count += 1
	elif a[i] == b[i] and b[i] != c[i] and a[i] != c[i]:
		count += 1
	else:
		continue

print(count)

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    S = [input() for _ in range(3)]

    ans = 0
    for n in range(N):
        chars = [0 for _ in range(ord('z') - ord('a') + 1)]
        for s in S:
            chars[ord(s[n]) - ord('a')] += 1
        ans += sum(sorted(chars, reverse=True)[1:])
    print(ans)

Solution (Python):
import sys

n=int(sys.stdin.readline())
a=sys.stdin.readline()
b=sys.stdin.readline()
c=sys.stdin.readline()


cnt = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        continue
    elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        cnt = cnt + 1
    else:
        cnt = cnt + 2
print(cnt)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

num_op = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        continue
    if a[i] != b[i] and a[i] != c[i] and b[i] != c[i]:
        num_op += 2
    elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
        num_op += 1
print(num_op)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())
count = 0
for i in range(0,N):
  count += len(list(set([A[i],B[i],C[i]]))) - 1
  
print(count)

Solution (Python):
n=input()
a,b,c=[raw_input() for _ in xrange(3)]
r=0
for i in xrange(n):
  l=set([a[i],b[i],c[i]])
  r+=len(l)-1
print r

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

if a == b == c:
  print(0)
  exit()

al = list(a)
bl = list(b)
cl = list(c)

cnt = 0
for i in range(n):
  
  if al[i] == bl[i] == cl[i]:
    continue
  
  if al[i] == bl[i]:
    cnt += 1
    continue
  elif al[i] == cl[i]:
    cnt += 1
    continue
  elif bl[i] == cl[i]:
    cnt += 1
    continue
  cnt += 2
print(cnt)

Solution (Python):
n = int(input())
s = [input() for i in range(3)]
count = 0
for i in range(n):
    char = set()
    char.add(s[0][i])
    char.add(s[1][i])
    char.add(s[2][i])
    count += len(char)-1
print(count)

Solution (Python):

n=input()
a=input()
b=input()
c=input()

n = int(n)

def classify(a,b,c):
	if (a==b)and (b==c):
		return 0
	else:
		if (a==b):
			return 1
		elif (b==c):
			return 1
		elif (c==a):
			return 1
		else:
			return 2

ans_sum = 0
for i in range(n):
	ans = classify(a[i], b[i], c[i])
	ans_sum+=ans

print(ans_sum)

Solution (Python):
n=int(input())
a=list(input())
b=list(input())
c=list(input())

ans=0
for i in range(n):
	tmp=set()
	tmp.add(a[i])
	tmp.add(b[i])
	tmp.add(c[i])
	ans+=len(tmp)-1
	tmp=set()

print(ans)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

count = 0
for i in range(N):
    dic = {A[i]: 1}
    if B[i] in dic:
        dic[B[i]] += 1
    else:
        dic[B[i]] = 1

    if C[i] in dic:
        dic[C[i]] += 1
    else:
        dic[C[i]] = 1

    if len(dic) == 3:
        count += 2
    elif len(dic) == 2:
        count += 1
    elif len(dic) == 1:
        pass

print(count)

Solution (Python):
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    c+=[0,0,1,2][len(set([A[s],B[s],C[s]]))]
print(c)

Solution (Python):
N, = [int(x) for x in input().split()]
A = input()
B = input()
C = input()
r = 0
for i in range(N):
  r += [0,0,1,2][len(set((A[i],B[i],C[i])))]
print(r)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
cnt=0
for i in range(n):
  if a[i]==b[i] and b[i]==c[i]:
    continue
  if a[i]==b[i] or c[i]==b[i] or a[i]==c[i]:
    cnt+=1
  else:
    cnt+=2
print(cnt)

Solution (Python):
length = int(input())
a, b, c = [input() for i in range(3)]
ans = 0
for i in range(length):
  if a[i]==b[i]==c[i]: ans += 0
  elif a[i]==b[i] or b[i]==c[i] or c[i]==a[i]: ans += 1
  else: ans += 2
print(ans)

Solution (Python):
N = int(input())
S1 = input()
S2 = input()
S3 = input()

ans = 0
for i in range(N):
    youso = set()
    youso.add(S1[i])
    youso.add(S2[i])
    youso.add(S3[i])
    ans += len(youso) - 1

print(ans)

Solution (Python):
from collections import Counter
n=int(input())
a=input()
b=input()
c=input()
t=0
for i in range(0,n):
    t+=abs(Counter([a[i],b[i],c[i]]).most_common(1)[0][1] - 3)
print(t)

Solution (Python):
n=int(input())
a=list(input())
b=list(input())
c=list(input())
cnt=0

for i in range(len(a)):
  if a[i]==b[i] and a[i]==c[i] and b[i]==c[i]:
    continue
  elif a[i]==b[i] or a[i]==c[i] or b[i]==c[i]:
    cnt+=1
  else:
    cnt+=2

print(cnt)

Solution (Python):
import sys
import collections

n = int(sys.stdin.readline().strip())
l = sys.stdin.readlines()
l = [x.strip() for x in l]

sum = 0

for i in range(n):
  l2 = [l[j][i] for j in range(3)]
  c = collections.Counter(l2)
  most = c.most_common()[0][1]
  if most == 1:
    
    sum += 2
  elif most == 2:
    sum += 1

print(sum)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

num = 0
for i in range(n):
  if a[i] != b[i] != c[i] and a[i] != c[i]:
    num = num+2
  elif a[i] == b[i] and b[i] != c[i]:
    num = num+1
  elif b[i] == c[i] and b[i] != a[i]:
    num = num+1
  elif a[i] == c[i] and a[i] != b[i]:
    num = num + 1

print(num)

Solution (Python):
n=int(input())

a=input()
b=input()
c=input()

count=0
for i in range(n):
    if(a[i]==b[i] and b[i]==c[i]):
        continue
    elif(a[i]==b[i] and b[i]!=c[i]):
        count+=1
    elif(a[i]!=b[i] and b[i]==c[i]):
        count+=1
    elif(a[i]==c[i] and b[i]!=c[i]):
        count+=1
    elif(a[i]!=b[i] and c[i]!=b[i]):
        count+=2

print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
x = 0
for i in range(n):
	if a[i]==b[i]==c[i]: pass
	elif a[i]==b[i] or b[i]==c[i] or c[i]==a[i]: x+=1
	else: x+=2
print(x)

Solution (Python):

N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
    len_diff = len(set([A[i], B[i], C[i]]))
    if len_diff == 3:
        ans += 2
    elif len_diff == 2:
        ans += 1
print(ans)

Solution (Python):
from collections import Counter
n=int(input())
a=input()
b=input()
c=input()
i=0
ans=""
while i<len(a):
  tmp=[]
  tmp.append(a[i])
  tmp.append(b[i])
  tmp.append(c[i])
  tmp=Counter(tmp)
  ans+=tmp.most_common()[0][0]
  i+=1
diff=0
i=0
while i<len(a):
  if a[i]!=ans[i]:
    diff+=1
  if b[i]!=ans[i]:
    diff+=1
  if c[i]!=ans[i]:
    diff+=1
  i+=1
print(diff)

Solution (Python):
N = int(input())

A = [a for a in input()]

B = [b for b in input()]

C = [c for c in input()]

count = 0

for i in range(N):
	if ( A[i] == B[i] and A[i] != C[i] ) \
	or ( B[i] == C[i] and B[i] != A[i] ) \
	or ( C[i] == A[i] and C[i] != B[i] ):
		count += 1
	if  A[i] != B[i] \
	and B[i] != C[i] \
	and C[i] != A[i]:
		count += 2

print(count)

Solution (Python):
input()
a,b,c = [input() for i in range(3)]
sum=0
for i in range(len(a)):
    sum += len(set([a[i],b[i],c[i]])) - 1
print(sum)

Solution (Python):
input()
a,b,c=[input() for i in range(3)]

cnt=0
for a_,b_,c_ in zip(a,b,c):
    cnt += len(list({a_,b_,c_}))-1
    
print(cnt)

Solution (Python):
import numpy as np

N=int(input())
A=input()
B=input()
C=input()

S=set()
ans=0

for i in range(N):
    S.add(A[i])
    S.add(B[i])
    S.add(C[i])
    ans+=len(S)-1
    S.clear()
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        pass
    elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        ans += 1
    else:
        ans += 2
print(ans)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
def d(i):
    x=a[i]
    y=b[i]
    z=c[i]
    if x==y and y==z:
        return 0
    elif x==y or y==z or z==x:
        return 1
    else:
        return 2
r=0
for i in range(n):
    r += d(i)

print(r)

Solution (Python):
line = int(input())
a = list(input())
b = list(input())
c = list(input())
count = 0
for i in range(line):
    list =[]
    list.append(a[i])
    list.append(b[i])
    list.append(c[i])
    a_w = list.count(list[0])
    b_w = list.count(list[1])
    if a_w + b_w == 2:
        count+=2
    elif a_w + b_w == 3:
        count+=1
    elif a_w + b_w == 4:
        count+=1
print(count)

Solution (Python):
n = int(input())
words = []
for i in range(3):
  words.append(input())
w_T = [x for x in zip(*words)]
count = 0
for w in w_T:
  count += len(set(w))
print(count-n)

Solution (Python):
n= int(input())

a=  input()
b = input()
c = input()

totalcount=0
for i in range(n):
    count=2
    if a[i] == b[i]:
        count=1
        if  b[i]==c[i]:
            count=0
    elif a[i] == c[i]:
        count=1
    elif b[i]==c[i]:
        count=1
    totalcount+=count
print(totalcount)

Solution (Python):
def main():
    n = int(input())
    A = input()
    B = input()
    C = input()
    count = 0
    for i in range(n):
        a = A[i]
        b = B[i]
        c = C[i]
        if a == b == c:
            continue
        elif a == b or b == c or c == a:
            count += 1
        else:
            count += 2
    print(count)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a,b,c = input(),input(),input()

ans = 0
for i in range(n):
  cnt = len(set([a[i],b[i],c[i]]))-1
  ans += cnt

print(ans)

Solution (Python):
N =int(input())
A,B,C =[input()for i in range(3)]
def check(a,b,c):
    n1 =[a,b,c].count(a)
    n2 =[a,b,c].count(b)
    n3 =[a,b,c].count(c)
    n =max(n1,n2,n3)
    return 3-n
ans = 0
for i in range(N):
    ans += check(A[i],B[i],C[i])
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
count = 0

for i in range(n):
    if a[i] != b[i]:
        count += 1
    if b[i] != c[i]:
        if a[i] != c[i]:
            count += 1
print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

count = 0

for i in range(n):
    if a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        count = count + 2
    elif a[i] == b[i] and b[i] == c[i]:
        count = count
    else:
        count = count + 1

print(count)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
iC = 0
for i in range(N):
    a = A[i]
    b = B[i]
    c = C[i]
    if a != b and b != c and c != a :
        iC += 2
    elif a != b or b != c or c != a :
        iC += 1
print(iC)

Solution (Python):
N=int(input())
S=[input() for _ in range(3)]
ans=0
for a,b,c in zip(*S):
    same=0
    if a==b:same+=1
    if a==c:same+=1
    if b==c:same+=1
    ans+=max(2-same,0)
print(ans)

Solution (Python):
import math
import sys




N = int(input())
A = str(input())
B = str(input())
C = str(input())

ans = 0
for i in range(N):
	if (A[i] != B[i] and B[i] != C[i] and A[i] != C[i]):
		ans += 2
	elif (A[i] != B[i] or B[i] != C[i] or A[i] != C[i]):
		ans += 1

print(ans)

Solution (Python):
n = int(input())
a,b,c = input(),input(),input()

count = 0
for i in range(n):
    count += len(set([a[i],b[i],c[i]]))-1
print(count)

Solution (Python):
def main():
    raw = []
    for i in range(4):
        raw.append(input())

    n = int(raw[0])
    a = raw[1]
    b = raw[2]
    c = raw[3]

    difference = [0] * n
    for i in range(n):
        n = {a[i], b[i], c[i]}
        difference[i] = len(n) - 1

    print(sum(difference))


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()

ret = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        continue
    if a[i] == b[i] or b[i] == c[i] or a[i] == c[i] :
        ret += 1
    else:
        ret += 2

print(ret)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
    if A[i]==B[i]==C[i]:
        continue
    elif A[i]==B[i] or B[i]==C[i] or C[i]==A[i]:
        ans += 1
    else:
        ans += 2

print(ans)

Solution (Python):


n = int(input())
a = input()
b = input()
c = input()

d = [{} for i in range(n)]

for i in range(n):
    for s in [a,b,c]:
        if s[i] in d[i]:
            d[i][s[i]] += 1
        else:
            d[i][s[i]] = 1

count = 0
for subd in d:
    if len(d) > 1:
        count += 3 - max(subd.values())

print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

res = 0
for i in range(n):
    res += len(set([a[i], b[i], c[i]])) -1 if len(set([a[i], b[i], c[i]])) != 1 else 0

print(res)

Solution (Python):



from collections import Counter

def solveProblem(strLength,strA,strB,strC):
	
	answer = 0
	for i in range(0,strLength,+1):
		charList = [strA[i],strB[i],strC[i]]
		constructSet = set(charList) 
		constLen = len(constructSet)-1 
		answer = answer+constLen
	return answer

if __name__ == '__main__':
	N = int(input().strip())
	A = str(input().strip())
	B =  str(input().strip())
	C = str(input().strip())
	solution = solveProblem(N,A,B,C)
	print("{}".format(solution))

Solution (Python):
I = int(input())
A = input()
B = input()
C = input()

count = 0
for i in range(I):
  if not (A[i]==B[i]==C[i]):
    count += 1 if A[i]==B[i] or B[i]== C[i] or A[i]==C[i] else 2

print(count)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())
cnt = 0

for i in range(N):
  if A[i] == B[i] == C[i]:
    cnt += 0
  elif A[i] == B[i] or B[i] == C[i] or C[i] == A[i]:
    cnt += 1
  else:
    cnt += 2

print(cnt)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

count=0

for (a, b, c) in zip(A, B, C):
    s={a, b, c}
    count+=len(s)-1

print(count)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
 
 
def cal_chenge_num(a, b, c):
    if a==b:
        if a==c:
            return 0
        else:
            return 1
    else:
        if a==c or b==c:
            return 1
        else:
            return 2
 
num = 0
for i in range(N):
    num += cal_chenge_num(A[i], B[i], C[i])
print(num)

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()

ans = 0
for i in range(N):
    abc = A[i], B[i], C[i]
    ans += len(set(abc)) - 1
print(ans)

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()

ans = 0
for i in range(N):
    a, b, c = A[i], B[i], C[i]
    ans += len(set(tuple((a, b, c)))) - 1
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
count = 0 
for i in range(n):
    if a[i] == b[i]:
        if b[i] != c[i]:
            count += 1
    else:
        if a[i] == c[i] or b[i] == c[i]:
            count += 1
        else:
            count += 2
print(count)

Solution (Python):
n,a,b,c = int(input()),input(),input(),input()
ans = 0
for i in range(n):
    al = set()
    al.add(a[i])
    al.add(b[i])
    al.add(c[i])
    ans += len(al)-1
print(ans)

Solution (Python):
import sys
import collections


def r(n, a, b, c):

    cnt = 0
    for i in range(len(a)):
        cn = collections.Counter([a[i], b[i], c[i]])
        cc = [k for k, v in cn.items() if v == 1]
        if len(cc) == 3:
            cnt += len(cc) - 1
        else:
            cnt += len(cc)

    return cnt

def main():
    input = sys.stdin.readline
    n = int(input())
    a = input()
    b = input()
    c = input()

    print(r(n, a, b, c))


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=list(input())
b=list(input())
c=list(input())

ans=0

for i in range(n):

    s=[a[i],b[i],c[i]]
    buff=set(s)
    ans += len(buff)-1

print(ans)

Solution (Python):
N = int(input())
A, B, C = map(list, ([input(), input(), input()]))
cnt = 0
for i in range(N):
  a = 0
  if A[i] == B[i]:
    a += 1
  if B[i] == C[i]:
    a += 1
  if C[i] == A[i]:
    a += 1
  if a == 0:
    cnt += 2
  elif a == 1:
    cnt += 1

print(cnt)

Solution (Python):
n, a, b, c = int(input()), input(), input(), input()
letters = dict()

count = 0
for i in range(n):
    letters[i] = {a[i], b[i], c[i]}
    count += len(letters[i]) - 1

print(count)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())
cnt = 0
for i in range(N):
    l = [A[i], B[i], C[i]]
    
    s = set(l)
    c = [l.count(s_) for s_ in s]
    cnt += 3- max(c)
print(cnt)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
    if a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        ans += 2
    elif a[i] != b[i] or b[i]!=c[i] or c[i]!=a[i]:
        ans+=1
print(ans)

Solution (Python):
def main(n,a,b,c):
    cnt=0
    for i in range(n):
        if a[i]==b[i]==c[i]:
            pass
        elif a[i]!=b[i] and b[i]!=c[i] and a[i]!=c[i]:
            cnt+=2
        else:
            cnt+=1
    return cnt
print(main(int(input()),[i for i in input()],[i for i in input()],[i for i in input()]))

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for i in range(N):
	
	if A[i] != B[i]:
		count+=1
		if A[i] != C[i] and B[i] != C[i]:
			count+=1

	elif A[i] != C[i]:
		count+=1

print(count)

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())
ans = 0
for i in range(n):
    k = [a[i], b[i], c[i]]
    ans += len(set(k))-1

print(ans)

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
src = [SI() for _ in range(3)]

ans = 0
for abc in zip(*src):
    ans += len(set(abc)) - 1

print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
    s = list(set([A[i],B[i],C[i]]))
    ans += len(s) - 1
print(ans)

Solution (Python):
N = int(input())
a = [set() for i in range(N)]

for i in range(3):
  x = input()
  for j in range(N):
    a[j].add(x[j])

res = 0
for s in a:
  res += len(s) - 1

print(res)

Solution (Python):
input()
print(sum(len(set(_)) - 1 for _ in zip(*(input() for _ in range(3)))))

Solution (Python):
input()
print(sum(len(set(_)) - 1 for _ in zip(*[list(input()) for _ in range(3)])))

Solution (Python):



def main():
    n = int(input())
    a = input()
    b = input()
    c = input()
    ans = 0

    for i in range(n):
        s = set()
        s.add(a[i])
        s.add(b[i])
        s.add(c[i])

        if len(s) == 2:
            ans += 1
        elif len(s) == 3:
            ans += 2

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a, b, c = input(), input(), input()
ans = 0
for i in range(n):
    ans += len(set([a[i], b[i], c[i]])) - 1
print(ans)

Solution (Python):
n = int(input())
a, b, c = input(), input(), input()
ans = 0
for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        continue
    if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        ans += 1
    else:
        ans += 2
print(ans)

Solution (Python):
I=input;I();print(sum(len(set(s))-1for s in zip(I(),I(),I())))

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    ans += len(set([a[i], b[i], c[i]])) - 1
print(ans)

Solution (Python):
n=int(input())
a,b,c=input(),input(),input()
ct=0
for i in range(n):
  if a[i]==b[i]==c[i]:ct+=0
  elif a[i]==b[i] or b[i]==c[i] or c[i]==a[i]:ct+=1
  else:ct+=2
print(ct)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i,j,k in zip(a,b,c):
        if i == k and k == j:
                continue
        elif i == j or j== k or i == k:
                ans += 1
        else:
                ans+=2
print(ans)

Solution (Python):
n = int(input())
p = input()
q = input()
r = input()
res = 0
for (a,b,c) in zip(p,q,r):
    if a == b == c:
        pass
    elif a == b or b == c or c == a:
        res += 1
    elif a != b and b != c and c != a:
        res += 2
    
print(res)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

count = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        pass
    elif A[i] == B[i] or B[i] == C[i] or C[i] == A[i]:
        count += 1
    else:
        count += 2

print(count)

Solution (Python):
n = int(input())
lst = [input() for i in range(3)]

cnt = 0

for i in range(n):
    a = lst[0][i]
    b = lst[1][i]
    c = lst[2][i]

    if a == b and b == c:
        pass
    elif a == b or b == c or c == a:
        cnt += 1
    else:
        cnt += 2

print(cnt)

Solution (Python):
n=int(input())
a,b,c=input(),input(),input()
ans=0
for i in range(n):
    if a[i]==b[i]==c[i]:
        continue
    if a[i]==b[i] or b[i]==c[i] or c[i]==a[i]:
        ans+=1
    else:
        ans+=2
print(ans)

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())

ans = 0
for x, y, z in zip(a, b, c):
    ans += len(set((x, y, z))) - 1
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

changeCount = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
      continue  
    elif (a[i] != b[i]) and (a[i] != c[i]) and (b[i] != c[i]):
        changeCount += 2
    else:
        changeCount += 1

print(changeCount)

Solution (Python):
N = int(input())
a, b, c = input(), input(), input()

ans = 0
for i in range(N):
    ans += len(set([a[i], b[i], c[i]])) - 1
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()


counter=0
for i in range(n):
    if (len(set((a[i], b[i], c[i]))) == 3):
        counter+=2
    elif(len(set((a[i], b[i], c[i]))) == 2):
        counter+=1
    else:
        counter+=0

print(counter)

Solution (Python):
n = int(input())

a = input()
b = input()
c = input()

ans = 0

for count in range(n):
    tmp = 0
    if a[count] == b[count]:
        if a[count] != c[count]:
            tmp += 1
    else:
        tmp += 1
        if (a[count] != c[count]) & (b[count] != c[count]):
            tmp += 1
    ans += tmp
    
print(ans)

Solution (Python):
n=int(input())
ans=0
for a,b,c in zip(input(),input(),input()):ans+=len(set([a,b,c]))-1
print(ans)

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()
ans = 0
for i in range(N):
    ans += len(set([A[i], B[i], C[i]])) - 1
print(ans)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())
score = 0


val_array = [{} for _ in range(N)]
for i in range(N):
    val_array[i][A[i]] = 0
    val_array[i][B[i]] = 0
    val_array[i][C[i]] = 0


for i in range(N):
    val_array[i][A[i]] += 1
    val_array[i][B[i]] += 1
    val_array[i][C[i]] += 1


for i in range(N):
    score += 3 - max(val_array[i].values())

print(score)

Solution (Python):


import sys

lines = sys.stdin.readlines()

n,a,b,c = lines
n = int(n.strip('\n'))
a = str(a.strip('\n'))
b = str(b.strip('\n'))
c = str(c.strip('\n'))

num = 0
if not(n == a == b == c):
  for i in range(n):
    if not(a[i] == b[i] == c[i]):
      if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        num = num+1
      else:
        num = num+2

print(num)       

sys.exit(0)

Solution (Python):
from sys import stdin

a = []
for line in stdin:
    a.append(line.rstrip())

N, A, B, C = a


def split(X):
    arr = []
    for i in X:
        arr.append(i)
    return arr


def diff(X, Y, Z):
    sum = 0
    for i in range(0, int(N)):
        if(X[i] != Y[i] and X[i] != Z[i] and Y[i] != Z[i]):
            sum += 2
        elif(X[i] == Y[i] and X[i] == Z[i] and Y[i] == Z[i]):
            next
        elif(X[i] == Y[i] or X[i] == Z[i] or Y[i] == Z[i]):
            sum += 1
    return sum


spA = split(A)
spB = split(B)
spC = split(C)

diffSum = diff(A, B, C)

print(diffSum)

Solution (Python):
N = int(input())
A = input()
listA = list(A)
B = input()
listB = list(B)
C = input()
listC = list(C)
count = 0
for i in range(N):
    if listA[i] != listB[i] and listB[i] != listC[i] and listC[i] != listA[i]:
        count += 2
    elif listA[i] == listB[i] and listB[i] != listC[i]:
        count += 1
    elif listB[i] == listC[i] and listC[i] != listA[i]:
        count += 1
    elif listA[i] == listC[i] and listA[i] != listB[i]:
        count += 1
    elif listA[i] == listB[i] and listB[i] == listC[i] and listC[i] == listA[i]:
        count += 0
print(count)

Solution (Python):
import bisect
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    A = ii(str)
    B = ii(str)
    C = ii(str)
    ans = 0
    for i in range(N):
        t = A[i] != B[i]
        t += B[i] != C[i]
        t += C[i] != A[i]
        ans += max(t - 1, 0)
    return ans


if __name__ == "__main__":
    print(solve())

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

x = 0
for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        continue
    if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        x = x + 1
    else:
        x = x + 2

print(x)

Solution (Python):
n=int(input())
a=str(input())
b=str(input())
c=str(input())
ans=0

for i in range(n):
  se = set([a[i],b[i],c[i]])
  ans=ans+len(se)-1

print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
target_list = []
for a, b, c in zip(A, B, C):
    if a==b and b==c and c==a:
        target_list.append(3)
    elif a==b or b==c or c==a: 
        target_list.append(2)
    else:
        target_list.append(1)
print(N*3 - sum(target_list))

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
  str = (A[i:i+1]+B[i:i+1]+C[i:i+1])
  ans += (len(set(str)) -1)
print(ans)

Solution (Python):
N = int(input())
A = str(input())
B = str(input())
C = str(input())

ans = []
for i in range(N):
     L = [A[i],B[i],C[i]]
     if len(set(L)) == 2:
            ans.append(1)
     elif len(set(L)) == 3:
            ans.append(2)
     else:
            ans.append(0)
print(sum(ans))

Solution (Python):
N = input()
word = [["x"],["x"],["x"]]
for i in range(3):
    inp = input()
    word[i] = list(inp)

X = 0
for i in range(int(N)):
    _count = 0
    for j in range(2):
        for k in range(j+1,3):
            if word[j][i] == word[k][i]:
                _count += 1
    if _count == 1:
        count = 1
    elif _count == 0:
        count = 2
    else:
    	count = 0
    X += count



print (X)