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):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

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

Solution (Python):
N = int(input())
S1 = input()
S2 = input()
S3 = input()
ans = 0
for i in range(N):
  if S1[i] == S2[i] == S3[i]:
    ans += 0
  elif S1[i] != S2[i] and S2[i] != S3[i] and S3[i] != S1[i]:
    ans += 2
  else:
    ans += 1
print(ans)

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

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

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
d=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 a[i]==c[i]:
    d+=1
  else:
    d+=2
print(d)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
count=N*2
d=0
for i in range(N):
    if A[i]==B[i]==C[i]:
        count += -1
        
    if A[i]==B[i] or A[i]==C[i] or B[i]==C[i]:
        count += -1
        

print(count)

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

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
  if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Solution (Python):
import math

b=int(input())





j = [input() for _ in range(3)]
a1=[i for i in j[0]]
a2=[i for i in j[1]]
a3=[i for i in j[2]]

count=0

for i in range(b):
    if a1[i]==a2[i]==a3[i]:
        count+=0
    elif a1[i]==a2[i] or a1[i]==a3[i] or a2[i]==a3[i]:
        count+=1
    else:
        count+=2

print(count)

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] and b[i] != c[i] and c[i] != a[i]:
        ans += 2
    else:
        ans += 1
print(ans)

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

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

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

print(count)

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())
S = [input() for _ in range(3)]
ans = 0
for i in range(N):
    ans += len(set([S[0][i], S[1][i], S[2][i]]))-1
print(ans)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    A = input()
    B = input()
    C = input()
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())
A, B, C = [input() for _ in range(3)]

operations = 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]:
        operations += 1
    else:
        operations += 2

print(operations)

Solution (Python):
from collections import Counter

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

D=[]
for i in range(N):
  mc = Counter([A[i],B[i],C[i]]).most_common()[0][0]
  D.append(mc)
D=''.join(D)
  
def diff(s1,s2):
  out=0
  for i in range(len(s1)):
    if s1[i] != s2[i]:
      out += 1
  return out

ans=0
ans+=diff(D,A)
ans+=diff(D,B)
ans+=diff(D,C)

print(ans)

Solution (Python):
def main():
    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)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    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]:
            continue
        elif a[i] == b[i] and b[i] != c[i]:
            ans += 1
        elif b[i] == c[i] and c[i] != a[i]:
            ans += 1
        elif c[i] == a[i] and a[i] != b[i]:
            ans += 1
        else:
            ans += 2

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
l = [list(input()) for _ in range(3)]

x=[[] for _ in range(n)]
for i in range(3):
    for j in range(n):
        x[j].append(l[i][j])

ans=0
for i in x:
    ans += len(set(i)) - 1

print(ans)

Solution (Python):
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def lcm(a, b):
    return a*b//math.gcd(a, b)


def main():
    N, A, B, C = [ii(), input(), input(), input()]
    cnt = 0

    for i in range(N):
        k = len(set([A[i], B[i], C[i]]))
        if k == 2:
            cnt += 1
        if k == 3:
            cnt += 2
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
abc = [list(input()) for _ in range(3)]
ans = 2 * n
for j in range(n):
    x = 0
    for i in range(3):
        if abc[i][j] == abc[(i + 1) % 3][j]:
            x += 1
        if x >= 2:
            break
    ans -= x
print(ans)

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

Solution (Python):
N=int(input())
S=[input() for i in range(3)]
ans=0
for i in range(N):
    s=set([S[j][i] for j in range(3)])
    ans+=len(s)-1
print(ans)

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

answer=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:
    answer+=1
  else:
    answer+=2
    
print(answer)

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]:
        pass
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        ans += 2
    else:
        ans += 1
print(ans)

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

Solution (Python):
'''
Created on 2020/08/21

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  A=pin()[:-1]
  B=pin()[:-1]
  C=pin()[:-1]
  ans=0
  for i in range(N):
    l=[A[i],B[i],C[i]]
    t=len(list(set(l)))
    ans+=t-1
  print(ans)
  return 
main()

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 = input()
b = input()
c = input()

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

print(cnt)

Solution (Python):
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]:
    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())
A=list(input())
B=list(input())
C=list(input())
a=0
for i in range(N):
    if A[i]!=B[i] and B[i]!=C[i] and C[i]!=A[i]:
        a+=2
    elif A[i]==B[i] and B[i]==C[i]:
        a+=0
    else:
        a+=1
print(a)

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] and a[i]!=c[i] and b[i]!=c[i]:
        ans+=2
    else:
        ans+=1
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]==c[i]:
        continue
    elif a[i]!=b[i] and a[i]!=c[i] and b[i]!=c[i]:
        ans+=2
    else:
        ans+=1
print(ans)

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


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

Solution (Python):
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)

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):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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

ans = 0
for i in range(N):
    cost = INF
    for w in range(26):
        now = 0
        if ord(a[i]) != (w + ord('a')):
            now += 1
        if ord(b[i]) != (w + ord('a')):
            now += 1
        if ord(c[i]) != (w + ord('a')):
            now += 1
        cost = min(now, cost)
    ans += cost
print(ans)

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] and c[i] != a[i]:
        cnt += 2
    elif a[i] == b[i] == c[i]:
        cnt += 0
    else:
        cnt += 1
print(cnt)

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

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

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

print(ans)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    A = SS()
    B = SS()
    C = SS()

    ans = sum([len(set(s)) - 1 for s in zip(A, B, C)])
    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = readline().decode('utf-8').strip()
    B = readline().decode('utf-8').strip()
    C = readline().decode('utf-8').strip()
    ans = 0
    for i in range(N):
        if A[i]==B[i]==C[i]:
            continue
        elif A[i]!=B[i] and B[i]!=C[i] and C[i]!=A[i]:
            ans += 2
        else:
            ans += 1
    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):
import sys
import collections
import bisect


def main():
    [n, a, b, c] = [input() for _ in range(4)]
    print(sum((len(set([a[i], b[i], c[i]]))-1) for i in range(int(n))))


if __name__ == '__main__':
    main()

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

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] != a[i]:
        ans += 2
    elif a[i] == b[i] == c[i]:
        ans += 0
    else:
        ans += 1
print(ans)

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

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

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

for i in range(N):
	if not(A[i]==B[i]) and not(B[i]==C[i]) and not(C[i]==A[i]):
		r += 2
	elif not(A[i]==B[i] and B[i]==C[i]):
		r += 1
print(r)

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

ans=0
for a,b,c in zip(*[A,B,C]):
    ans+=len(set([a,b,c]))-1
print(ans)

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

res = 0
for a, b, c in zip(A, B, C):
    if a != b and b != c and c != a:
        res += 2
    elif a == b == c:
        pass
    else:
        res += 1

print(res)

Solution (Python):
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]:
    ans=ans
  elif a[i]!=b[i] and b[i]!=c[i] and c[i]!=a[i]:
    ans=ans+2
  else:
    ans=ans+1
print(ans)

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

for i in range(3):
    for j in input().split():
        for k, l in enumerate(j):
            ans[k][i] = l
a = 0
for i in ans:
    a += len(set(i))-1
print(a)

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

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

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

print(p)

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 not (a[i] == b[i] == c[i]):
    ans += 1
  else:
    pass
print(ans)

Solution (Python):
def main():
    n = int(input())
    A = input()
    B = input()
    C = input()
    ans = 0
    for a in zip(A, B, C):
        if len(set(a)) == 2:
            ans += 1
        elif len(set(a)) == 3:
            ans += 2
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
s = set()
res = 0

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

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
A = stdin.readline().rstrip()
B = stdin.readline().rstrip()
C = stdin.readline().rstrip()
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()
res = 0
for i in range(n):
  res += (len(set([a[i], b[i], c[i]])) - 1)
print(res)

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    n = ii()
    a, b, c = input(), input(), input()
    ans = 0
    for i in range(n):
        s = list(set((a[i], b[i], c[i])))
        ans += len(s) - 1
    print(ans)



if __name__ == "__main__":
    main()

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 a[i]!=c[i]:
    ans+=2
  elif a[i]==b[i] and b[i]==c[i]:
    None
  else:
    ans+=1
print(ans)

Solution (Python):


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=[]
    for i in range(3):
        A.append(input())
        
    ans=0
    for i in range(N):
        t=set([])
        for j in range(3):
            t.add(A[j][i])
        ans+=len(t)-1
        
    print(ans)
        

main()

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

cnt = 0
for i in range(n):
    s = set((L[0][i],L[1][i],L[2][i]))
    cnt += len(s)-1
print(cnt)

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

ans=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]:
        ans+=1
    elif a[i]!=c[i] and a[i]==b[i]:
        ans+=1
    elif b[i]!=c[i] and a[i]==c[i]:
        ans+=1
    else:
        ans+=2
print(ans)

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]:
            pass
        elif a[i]==b[i] or a[i]==c[i] or b[i]==c[i]:
            cnt+=1
        else:
            cnt+=2
print(cnt)

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    input = stdin.readline
    n = int(input())
    a = list(input()[:-1])
    b = list(input()[:-1])
    c = list(input()[:-1])

    ans = 0
    for ai, bi, ci in zip(a, b, c):
        ans += len(list(set([ai, bi, ci]))) - 1

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

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

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

Solution (Python):
n = int(input())
a_str = input()
b_str = input()
c_str = input()

ans = 0
for a, b, c in zip(a_str, b_str, c_str):
    if a == b == c:
        continue
    elif a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2
print(ans)

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

Solution (Python):
def main():
    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)


if __name__ == "__main__":
    main()

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

Solution (Python):
def resolve():
    N = int(input())
    A = input()
    B = input()
    C = input()
    ans = 0
    for i in range(N):
        if A[i] != B[i] != C[i] != A[i]:
            ans += 2
        elif A[i] == B[i] == C[i]:
            ans += 0
        else:
            ans += 1
    print(ans)
resolve()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N = INT()
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=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()
count = 0
for x in range(N):
    count += len(set([A[x], B[x], C[x]])) - 1
print(count)

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] and B[i] != C[i] and A[i] != C[i]: ans += 2
  else: ans += 1
print(ans)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






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






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = I()
A,B,C = SLs(3)
res = 0
for i in range(N):
  if A[i]==B[i]==C[i]:
    pass
  elif A[i]==B[i] or A[i]==C[i] or B[i]==C[i]:
    res += 1
  else:
    res += 2
print(res)

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

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

for i in range(n):
    x = a[i]
    y = b[i]
    z = c[i]

    if x == y == z:
        continue
    elif x != y and y != z and z != x:
        ans += 2
    else:
        ans += 1

print(ans)

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

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

nikkei19q_b()

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]:
        ans+=0
    elif a[i]!=b[i] and b[i]!=c[i] and c[i]!=a[i]:
        ans+=2
    else:
        ans+=1
print(ans)

Solution (Python):
N= int(input())
A= list(input())
B= list(input())
C= list(input())
ans=0
import collections
for i in range(N):
   l=[A[i],B[i],C[i]]
   l=collections.Counter(l).most_common()
   ans+=3-l[0][1]
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = input().rstrip()
    B = input().rstrip()
    C = input().rstrip()

    res = 0
    for a, b, c in zip(A, B, C):
        res += 1 if len(set(a + b + c)) == 2 else 2 if len(set(a + b + c)) == 3 else 0

    print(res)


if __name__ == '__main__':
    resolve()

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

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

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

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

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]:
        pass
    elif (a[i] != b[i]) and (b[i] != c[i]) and (c[i] != a[i]):
        ans += 2
    else:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
l = [input() for _ in range(3)]

ans = 0
for i in range(n):
    s = set()
    for x in l:
        s.add(x[i])

    ans += len(s) - 1

print(ans)

Solution (Python):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    N = int(input().rstrip())
    S1 = (input().rstrip())
    S2 = (input().rstrip())
    S3 = (input().rstrip())
    cnt = 0
    for x in range(N):
        ic = 0
        if(S1[x] == S2[x]):
            ic += 1
        if(S3[x] == S2[x]):
            ic += 1
        if(S1[x] == S3[x]):
            ic += 1    

        if(ic == 1):
            cnt += 1
        elif(ic < 1):
            cnt += 2
        else:
            cnt += 0
    
    print(cnt)

if __name__ == '__main__':
    solve()

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

ans = 0
for i in range(N):
    if a[0][i] != a[1][i] and a[1][i] != a[2][i] and a[0][i] != a[2][i]:
        ans += 2
    elif a[0][i] == a[1][i] and a[1][i] == a[2][i] and a[0][i] == a[2][i]:
        continue
    else:
        ans += 1
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = input().rstrip()
    B = input().rstrip()
    C = input().rstrip()

    ans = 0
    for a, b, c in zip(A, B, C):
        ans += len(set([a, b, c])) - 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = input().rstrip()
    B = input().rstrip()
    C = input().rstrip()

    ans = 0
    for a, b, c in zip(A, B, C):
        if a == b == c:
            pass
        elif a == b or b == c or c == a:
            ans += 1
        else:
            ans += 2

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n =int(input())
A = [x for x in list(str(input()))]
B = [x for x in list(str(input()))]
C = [x for x in list(str(input()))]
ans = 0

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

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] == C[i]:
        continue
    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())

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

print(ans)
    
        
        

'''
west
east
wait

{'w', 'e', 'w'}
{'w', 'e'}
len → 2 
1文字は使って良い -1


'''