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

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

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

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

Solution (Python):
N=int(input())
Sts=[list(input()) for i in range(3)]
ret=0
for i in range(N):
  ret+=len(set([Sts[0][i],Sts[1][i],Sts[2][i]]))-1
print(ret)

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

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

Solution (Python):
N=int(input())
def f(a,b,c):
    X=sorted([a,b,c])
    if a==b==c:
        return 0
    elif X[0]==X[1] or X[1]==X[2]:
        return 1
    else:
        return 2
print(sum(f(a,b,c) for a,b,c in zip(input(),input(),input())))

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
res = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        pass
    elif a[i] == b[i]  and b[i] != c[i]:
        res += 1
    elif a[i] != b[i] and b[i] == c[i]:
        res += 1
    elif a[i] == c[i] and 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] == 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):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n=int(input())
a=input()
b=input()
c=input()
def f(a,b,c):
  re=2
  if a==b:
    re-=1
  if c==b:
    re-=1
  if a==c:
    re-=1
  return max(0,re)
for i in range(n):
  count += f(a[i],b[i],c[i])
print(count)

Solution (Python):
n = int(input())
a = [i for i in input()]
b = [i for i in input()]
c = [i for i in input()]
ans = 0

for j in range(len(a)):
	
	if a[j] == b[j] == c[j]:
		ans += 0
	elif a[j] != b[j] and b[j] != c[j] and a[j] != c[j]:
		ans += 2
	else:
		ans += 1

print(ans)

Solution (Python):
n=int(input())
l=[input(),input(),input()]
c=0
for x in zip(*l):
  if len(set(x))==3:
    c+=2
  elif len(set(x))==2:
    c+=1
print(c)

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()

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

print(count)

Solution (Python):
from collections import defaultdict
N = int(input())
ABC = [input() for _ in range(3)]

ans = 0
for i in range(N):
    d = defaultdict(int)
    for j in range(3):
        d[ABC[j][i]] += 1
    ans += 3 - max(d.values())
print(ans)

Solution (Python):
N = int(raw_input())
A = list(raw_input())
B = raw_input()
C = raw_input()
con = 0
for i in range(N):
  if A[i] != B[i] and B[i] != C[i] and A[i] != C[i]:
    con += 2
  elif A[i] != B[i]:
    con += 1
  elif B[i] != C[i]:
    con += 1
  elif A[i] != C[i]:
    con += 1

print con

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

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = input()
    b = input()
    c = input()

    main(n, a, b, c)

Solution (Python):
def main():
    N = int(input())
    A = input()
    B = input()
    C = input()
    ans = 0
    for a,b,c in zip(A,B,C):
        now = set([a,b,c])
        if len(now)==1:
            pass
        elif len(now)==2:
            ans += 1
        else:
            ans += 2
    
    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 c[i] == a[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 = input()
b = input()
c = input()

cnt = 0

for i in range(n):
	num_unique = len(list(set([a[i],b[i],c[i]])))

	if num_unique == 3:
		cnt += 2
	elif num_unique == 2:
		cnt += 1
	else:
		cnt += 0

print(cnt)

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

import collections

cnt=0

for i in range(N):
    tmp=[]
    tmp.append(A[i])
    tmp.append(B[i])
    tmp.append(C[i])
    c = collections.Counter(tmp)
    values, counts = zip(*c.most_common())
    cnt+=3-counts[0]

print(cnt)

Solution (Python):
N,A,B,C = int(input()), input(), input(), input()
ans = 0
for a,b,c in zip(A,B,C):
  if a == b and b ==c: continue
  elif a==b or b==c or c==a: ans += 1
  elif a != b and b != c and c != a: ans += 2
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]:
        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 = input()
B = input()
C = input()
wordlst = [A, B, C]
cnt = 0
for i in range(N):
    tmp = 0
    for j in range(3):
        tmp += wordlst[j - 1][i].count(wordlst[j][i])
        tmp += wordlst[j - 2][i].count(wordlst[j][i])
    if tmp == 0:
        cnt += 2
    elif tmp == 2:
        cnt += 1

print(cnt)

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

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

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

Solution (Python):
import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = str(readline().rstrip().decode('utf-8'))
    b = str(readline().rstrip().decode('utf-8'))
    c = str(readline().rstrip().decode('utf-8'))
    cnt = 0
    for i in range(n):
        ct = collections.Counter([a[i], b[i], c[i]])
        if len(ct) == 3:
            cnt += 2
        elif len(ct) == 2:
            cnt += 1
        elif len(ct) == 1:
            cnt += 0
    print(cnt)


if __name__ == '__main__':
    solve()

Solution (Python):
n,*a=open(0);print(sum(len(x)-1for x in map(set,zip(*a))))

Solution (Python):
def examB():
    N = I()
    A = SI(); B = SI(); C = SI()
    ans = 2*N
    for i in range(N):
        cur = 0
        if A[i]==B[i]:
            cur +=1
        if B[i]==C[i]:
            cur +=1
        if C[i]==A[i]:
            cur +=1
        ans -=min(2,cur)
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

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

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

    print(cnt)


main()

Solution (Python):
N = int(input())
A = input().strip()
B = input().strip()
C = input().strip()
cnt = 0
for i in range(N):
    a = set([A[i],B[i],C[i]])
    if len(a)==3:
        cnt += 2
    elif len(a)==2:
        cnt += 1
print(cnt)

Solution (Python):


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

cnt=0
for aa,bb,cc in zip(a,b,c):
    tmp=set([aa,bb,cc])
    cnt+=len(tmp)-1
print(cnt)

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):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=ST()
    B=ST()
    C=ST()
    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):
N=int(input())
A=input()
B=input()
C=input()

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

print(ans)

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

ans = 0
for i in range(n):
  h = [a[i], b[i], c[i]]
  h.sort()
  if h[0] != h[1] and h[1] != h[2]:
    ans += 2
  elif h[0] != h[2]:
    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] or b[i] == c[i] or c[i] ==a[i]:
    if a[i] == b[i] == c[i]:
      continue
    else:
      ans += 1
  else:
    ans+= 2
print(ans)

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

ans = 0
for aa, bb, cc in zip(a,b,c):
  if aa == bb and bb == cc:
    pass
  elif aa == bb or bb == cc or cc == aa :
    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):
  if a[i].count(b[i]) + b[i].count(c[i]) + c[i].count(a[i]) != 3:
    ans += 2 - (a[i].count(b[i]) + b[i].count(c[i]) + c[i].count(a[i]))
print(ans)

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

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

Solution (Python):
n=int(input())
a=list(input())
b=list(input())
c=list(input())
co=0
for a,b,c in zip(a,b,c):
    if a==b==c:
        co+=0
    elif a==b or a==c or b==c:
        co+=1
    elif a!=b!=c:
        co+=2
print(co)

Solution (Python):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



N = int(sys.stdin.readline())
A = list(sys.stdin.readline().rstrip())
B = list(sys.stdin.readline().rstrip())
C = list(sys.stdin.readline().rstrip())

A = np.array(A, dtype='U1')
B = np.array(B, dtype='U1')
C = np.array(C, dtype='U1')


def count(a, b, c):
    if a == b == c:
        return 0
    if a == b or b == c or c == a:
        return 1
    return 2


ans = 0
for a, b, c in zip(A, B, C):
    ans += count(a, b, c)
print(ans)

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random

import os
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    A = input()
    B = input()
    C = input()
    
    ans = 0
    for i in range(N):
        if A[i] == B[i] and A[i] == C[i]:
            pass
        else:
            if A[i] != B[i] and A[i] != C[i] and B[i] != C[i]:
                ans += 2
            else:
                ans += 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):
  ans+=len(set([a[i],b[i],c[i]]))-1
print(ans)

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

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

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

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

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

for x,y,z in zip(a,b,c):
    if x == y == z:
        continue
    elif x == y or y == z or z == x:
        cnt += 1
    else:
        cnt += 2

print(cnt)

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

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

result = ""
sum = 0

def count_same(ca, cb, cc):
    ct = 0
    if ca == cb == cc:
        return 3
    if ca == cb:
        return ca
    if cb == cc:
        return cb
    if cc == ca:
        return cc
    return 0
for i in range(n):
    tmp = count_same(a[i], b[i], c[i])
    if tmp == 3:
        result += a[i]
    elif tmp == 0:
        result += a[i]
        sum += 2
    else:
        result += tmp
        sum += 1

print(sum)

Solution (Python):
n = int(input())
abc = [input() for i in range(3)]
d = [0]*n
for i in range(n):
    if abc[0][i]==abc[1][i]==abc[2][i]:
        d[i]=0
    elif abc[0][i]!=abc[1][i]!=abc[2][i]!=abc[0][i]:
        d[i]=2
    else:
        d[i]=1
print(sum(d))

Solution (Python):
import sys
input = sys.stdin.readline


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


difference = [0] * N
for i in range(N):
    if A[i] == B[i] == C[i]:
        difference[i] = 0
    elif A[i] == B[i] and A[i] != C[i]:
        difference[i] = 1
    elif A[i] == C[i] and A[i] != B[i]:
        difference[i] = 1
    elif B[i] == C[i] and B[i] != A[i]:
        difference[i] = 1
    else:
        difference[i] = 2
print(sum(difference))

Solution (Python):
from sys import stdin
import fractions

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

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

print(point)

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] == c[i]:
        continue 
    elif a[i] == b[i]:
        c[i] = a[i]
        count+=1
    elif a[i] == c[i]:
        b[i] = a[i]
        count+=1        
    elif b[i] == c[i]:
        a[i] = b[i]
        count+=1        
    else:
        c[i] = a[i]
        b[i] = a[i]
        count+=2        

print(count)

Solution (Python):
N = input()
A, B, C = [input() for _ in range(3)]
ans = 0
for a, b, c in zip(A, B, C):
    if a == b == c:
        continue
    elif a != b and b != c and c != a:
        ans += 2
    elif a == b or b == c or c == a:
        ans += 1
print(ans)

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

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

ans = 0
for a, b, c in zip(A, B, C):
    if a != b and b != c and c != a:
        ans += 2
    elif a == b and b == c and c == a:
        pass
    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] and b[i] == c[i]:
        ans += 2
    elif a[i] == b[i]:
        ans += 1
    elif b[i] == c[i]:
        ans += 1
    elif a[i] == c[i]:
        ans += 1
print(n*2-ans)

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

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]:
        ans += 1
print(ans)

Solution (Python):
from collections import Counter


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

    cnt = 0
    for es in zip(a, b, c):
        ec = Counter(es)
        l = len(ec)
        if l == 3:
            cnt += 2
        elif l == 2:
            cnt += 1

    print(cnt)


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]:
    
    continue

  if a[i] != b[i] and a[i] != c[i] and b[i] != c[i]:
    
    ans = ans + 2
    continue

  
  ans = ans + 1

print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = [input() for i in range(3)]
res = 0
for i in range(n):
    if a[0][i] == a[1][i] == a[2][i]:
        continue
    if a[0][i] == a[1][i] or a[2][i] == a[1][i] or a[0][i] == a[2][i]:
        res += 1
    else:
        res += 2
print(res)

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

print(count)

Solution (Python):




n = int(input())

al = list(input())
bl = list(input())
cl = list(input())

ans = 0
for i,j,k in zip(al,bl,cl):
    a = [i,j,k]
    if max(a.count(i), a.count(j), a.count(k)) == 1:
        ans += 2
    elif max(a.count(i), a.count(j), a.count(k)) == 2:
        ans += 1
    else:
        pass
    
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 b[i]!=c[i] and c[i]!=a[i]:
        ans += 2
    else:
        ans += 1
print(ans)

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

count = 0

for i, j, k in zip(A,B,C):
    
    count = count + len(set([i,j,k])) - 1

print(count)

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

cnt = 0

for i, j, k in zip(a, b, c):
    cnt += len(set([i, j, k])) - 1
print(cnt)

Solution (Python):
from collections import Counter
n = int(input())
a,b,c = [input() for _ in range(3)]

ans = 0
for x,y,z in zip(a,b,c):
    c = Counter([x,y,z])
    ans += 3 - c.most_common()[0][-1]
        
print(ans)

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

Solution (Python):
from collections import Counter
N=int(input())
A=list(input())
B=list(input())
C=list(input())

ans=0
for i in range(N):
  c=list(Counter([A[i],B[i],C[i]]).values())
  if c==[1,1,1]:
    ans+=2
  elif c==[2,1] or c==[1,2]:
    ans+=1
  else:
    pass
print(ans)

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

for i in range(N):
    answer += len({A[i], B[i], C[i]}) - 1

print(answer)

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

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

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

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

Solution (Python):
n= int(input())
a=input()
b=input()
c=input()
d=[{a[i],b[i],c[i]} for i in range(n)]
ans=0
for i in range(n):
    ans+=len(d[i])-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] 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()
ans=0
for i in range(n):
    a=A[i]
    b=B[i]
    c=C[i]
    if a==b and b==c:
        pass
    elif a==b or a==c or b==c:
        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):
  if A[i] == B[i] == C[i]:
    continue
  elif A[i] == B[i] and B[i] != C[i]:
    ans += 1
  elif A[i] == C[i] and C[i] != B[i]:
    ans += 1
  elif B[i] == C[i] and 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 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 b[i]!=c[i]:
        ans+=1
    elif a[i]==c[i] and b[i]!=c[i]:
        ans+=1
    elif c[i]==b[i] and a[i]!=c[i]:
        ans+=1
    else:
        ans+=0
print(ans)

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

R=[len(set(x))-1 for x in zip(*ABC)]

print(sum(R))

Solution (Python):
n = int(input())
a = tuple(map(str, input()))
b = tuple(map(str, input()))
c = tuple(map(str, input()))
ans = 2*n
for i in range(n):
    if a[i] == b[i] == c[i]:
        ans -= 2
        continue
    elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        ans -= 1
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1

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

main()

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

ans = 0
for v in zip(*s):
    len_ = len(set(v))
    ans += len_ - 1

    
    
    
    
    
    
    

print(ans)

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

ans = 0
for i in range(N):
    temp = [A[i], B[i], C[i]]
    temp = set(temp)
    ans += len(temp)-1
    
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+=0
    elif A[i]!=B[i] and B[i]!=C[i] and C[i]!=A[i]:
        cnt+=2
    else:
        cnt+=1
print(cnt)

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

Solution (Python):
n = input()
A = list(input())
B = list(input())
C = list(input())

ans = 0
for a, b, c in zip(A, B, C):
    if len(set([a, b, c])) == 3:
        ans += 2
    elif len(set([a, b, c])) == 2:
        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]:
        if b[i]!=c[i]:
            ans+=1
    else:
        if b[i]==c[i]:
            ans+=1
        elif a[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):
  X=[0]*26
  X[ord(A[i])-ord('a')]+=1
  X[ord(B[i])-ord('a')]+=1
  X[ord(C[i])-ord('a')]+=1
  X.sort()
  ans+=3-X[25]
print(ans)

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

x = 0
for i,j,k in zip(a,b,c):
    if i != j and j != k and k != i:
        x += 2
    elif i == j and j == k:
        continue
    elif i == j or j == k or k == i:
        x += 1
print(x)

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

x = 0
for i,j,k in zip(a,b,c):
    if i != j and j != k and k != i:
        x += 2
    elif i == j and j == k:
        continue
    elif i == j or j == k or k == i:
        x += 1
print(x)

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

Solution (Python):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = str(input().rstrip('\n'))
    b = str(input().rstrip('\n'))
    c = str(input().rstrip('\n'))
    cnt = 0
    for i in range(n):
        s = collections.Counter([a[i], b[i], c[i]])
        if len(s) == 3:
            cnt += 2
        elif len(s) == 2:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()

Solution (Python):

import sys


def solve(N: int, A: str, B: str, C: str):

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

    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = next(tokens)  
    B = next(tokens)  
    C = next(tokens)  
    solve(N, A, B, C)

if __name__ == '__main__':
    main()

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

ans=0
for i in range(n):
    l=set(list(a[i]+b[i]+c[i]))
    if len(l)==3:ans+=2
    elif len(l)==2: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):
    if ( a[i] == b[i] and b[i] != c[i] ) or ( b[i] == c[i] and c[i] != a[i] ) or ( c[i] == a[i] and a[i] != b[i] ):
        ans+=1
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        ans+=2
print(ans)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = str(input().rstrip('\n'))
    b = str(input().rstrip('\n'))
    c = str(input().rstrip('\n'))
    cnt = 0
    for i in range(n):
        if a[i] == b[i] == c[i]:
            continue
        elif a[i] == b[i]:
            cnt += 1
        elif b[i] == c[i]:
            cnt += 1
        elif a[i] == c[i]:
            cnt += 1
        else:
            cnt += 2
    print(cnt)


if __name__ == '__main__':
    slove()

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

ans = 0

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

print(ans)

Solution (Python):

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


x=0

for i in range(len(a)):
    tmp = []
    tmp.append(a[i])
    tmp.append(b[i])
    tmp.append(c[i])
 
    d = len(list(set(tmp)))
    if d == 1:
        pass
    elif d == 2:
        x += 1
    else:
        x += 2

print(x)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for a, b, c in zip(A, B, C):
    ans += (len({a, b, c}) - 1)
print(ans)

Solution (Python):
n=int(input())
ans=[0]*n

s=[]
for i in range(3):
    s.append(list(input()))

for i in range(n):
    if s[0][i]==s[1][i] and s[1][i]==s[2][i]:
        ans[i]=0
    elif s[0][i]==s[1][i] or s[0][i]==s[2][i] or s[1][i]==s[2][i]:
        ans[i]=1
    else:
        ans[i]=2

print(sum(ans))