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 numpy as np


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

R_A = [None] * N
R_B = [None] * N
R_C = [None] * N

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

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

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

R = np.array([R_A, R_B, R_C])

print(sum(R.min(axis=0)))

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

ans = 0
for i in range(N):
    a,b,c = A[i],B[i],C[i]
    t = len(list(set([a,b,c])))
    if t == 1:
        pass
    elif t == 2:
        ans += 1
    elif t == 3:
        ans += 2

print(ans)

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

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]:
        cnt = cnt
    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
def count_dif(s, t, u):
    x = list(set([s, t, u]))
    return len(x)

for i in range(N):
    d = count_dif(A[i], B[i], C[i])
    count += d-1

print(count)

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

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

n = int(input())
ans = 0
A = list(input())
B = list(input())
C = list(input())

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 != b:
        ans += 1
    elif a == b and b == c:
        ans += 0
    else:
        ans += 2

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

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

Solution (Python):
def A():
    n, a, b = map(int, input().split())
    print(min(a, b), max(a + b - n, 0))


def B():
    N = int(input())
    A = input()
    B = input()
    C = input()
    cnt = 0
    ans = 0
    for i in range(N):
        cnt = 0
        if A[i] == B[i]:
            if B[i] == C[i]:
                cnt = cnt
            elif B[i] != C[i]:
                cnt += 1
        if A[i] != B[i]:
            if A[i] != C[i] and B[i] != C[i]:
                cnt += 3
            elif A[i] != C[i] and B[i] == C[i]:
                cnt += 1
            elif A[i] == C[i] and B[i] != C[i]:
                cnt += 1
        if cnt == 1:
            ans += 1
        elif cnt == 3:
            ans += 2

    print(ans)
B()

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]:
        ans+=0
    elif A[i]==B[i] or B[i]==C[i] or 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):
    d, e, f = a[i], b[i], c[i]
    if d == e == f:
        pass
    elif d == e or d == f or e == f:
        cnt += 1
    else:
        cnt += 2
print(cnt)

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

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

print(ans)

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

ans = 0
for i in range(N):
    tmp = 100
    for c in [A[i], B[i], C[i]]:
        cnt = 0
        for a in [A[i], B[i], C[i]]:
            if c!=a: cnt+=1
        tmp = min(tmp, cnt)
    ans += tmp
print(ans)

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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

N = n()

S = [line.strip() for line in sys.stdin]

M = len(S)

cost = 0
for i in xrange(N):
    count = collections.Counter()
    for j in xrange(M):
        count[S[j][i]] += 1
    cost += M - count.most_common(1)[0][1]

print cost

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

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

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

ans = sum(same)
print(ans)

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]):
    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 = str(input())
b = str(input())
c = str(input())
count = 0
for i in range(n):
    if a[i]==b[i]==c[i]:
        count += 0
    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())
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]:
        if a[i] == c[i] or b[i] == c[i]:
            count += 1
        else:
            count += 2
    elif b[i] != c[i]:
        if b[i] == a[i] or c[i] == a[i]:
            count += 1
        else:
            count += 2
    elif c[i] != a[i]:
        if c[i] == b[i] or a[i] == b[i]:
            count += 1
        else:
            count += 2
print(count)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, C):
    ans = 0
    for i in range(N):
        ans += len(set([A[i], B[i], C[i]])) - 1
    return ans


def main():
    N = read_int()
    A = read_str()
    B = read_str()
    C = read_str()
    print(slv(N, A, B, C))


if __name__ == '__main__':
    main()

Solution (Python):
def calc(a,b,c):
    res = 0
    if not a == b:
        res+=1
    if not a == c:
        res+=1
    if not b == c:
        res+=1
    if res > 1:
        return res - 1
    else:
        return res
        
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
    ans+=calc(A[i],B[i],C[i])
print(ans)

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

ans = 0

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

print(ans)

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

ans = 0
table = [2, 1, 10 * 9 + 7, 0]
for i in range(N):
    score = 0
    if S[0][i] == S[1][i]: score += 1
    if S[1][i] == S[2][i]: score += 1
    if S[2][i] == S[0][i]: score += 1
    ans += table[score]

print(ans)

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

ans = 0
for i in range(N):
    c = Counter()
    c[A[i]] += 1
    c[B[i]] += 1
    c[C[i]] += 1
    for j, (c, v) in enumerate(c.most_common()):
        if j == 0:
            continue
        ans += v
print(ans)

Solution (Python):
from string import ascii_lowercase
def inpl(): return list(map(int, input().split()))
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] 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):
    if a[i] == b[i] == c[i]:
        pass
    elif a[i] == b[i] or b[i] == c[i] or 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 a, b, c in zip(A, B, C):
    s = {a, b, c}
    if len(s) == 1:
        pass
    elif len(s) == 2:
        cnt += 1
    else:  
        cnt += 2
print(cnt)

Solution (Python):
N = int(input())
X = input()
Y = input()
Z = input()

ans = 0

for i in range(N):
  if  X[i] == Y[i] and Y[i] == Z[i]:
    ans += 0
  elif X[i] == Y[i] or Y[i] == Z[i] or Z[i] == X[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):
    if a[i]==b[i] and a[i]!=c[i]:
        ans = ans+1
    elif a[i]!=b[i] and a[i]==c[i]:
        ans = ans+1
    elif c[i]==b[i] and a[i]!=c[i]:
        ans = ans+1
    elif c[i]!=b[i] and a[i]!=c[i] and a[i]!=c[i]:
        ans = ans+2
    
print(ans)

Solution (Python):


import numpy as np
import scipy

from collections import defaultdict
from pprint import pprint

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):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


def get_str():
    return input().strip()


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    n = get_int()
    a = get_char_list()
    b = get_char_list()
    c = get_char_list()

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


if __name__ == '__main__':
    main()

Solution (Python):
import math
import copy




def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input())
a=input()
b=input()
c=input()
def func():
    result=0
    for idx in range(0,len(a)):
        if a[idx]==b[idx]==c[idx]:
            result+=0
        elif a[idx]!=b[idx] and a[idx]!=c[idx] and b[idx]!=c[idx]:
            result+=2
        else:
            result+=1
    return result

print(func())

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

Solution (Python):
n = int(raw_input())
a = raw_input()
b = raw_input()
c = raw_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()
ans = 0
for a, b, c in zip(A, B, C):
    if a == b and b == c:
        continue
    if a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2
print(ans)

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

counter = 0

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

print(counter)

Solution (Python):
n = int(input())
lis = [str(input()) for i in range(3)]
ans = 0
for i in range(n):
  if lis[0][i] == lis[1][i]:
    if lis[1][i] != lis[2][i]:
      ans += 1
  else:
    if lis[1][i] != lis[2][i] and lis[0][i] != lis[2][i]:
      ans += 2
    else:
      ans += 1
print(ans)

Solution (Python):
n = int(input())
abc = [input() for _ in range(3)]
sol = 0
for i in range(n):
  sol += -1 + len(set([abc[j][i] for j in range(3)]))
print(sol)

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

res = 0

for a, b, c in zip(A, B, C):
    if a == b and b == c:
        res += 0
    elif a == b or b == c or c == a:
        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):
    ans += len(set([A[i], B[i], C[i]])) - 1

print(ans)

Solution (Python):
from collections import Counter

if __name__ == '__main__':
    n = int(input())
    a = input()
    b = input()
    c = input()
    ans = 0
    for t in zip(a, b, c):
        count = Counter(t)
        ans += len(count.values()) - 1
    print(ans)

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

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]:
    cnt += 1
    if A[i] != C[i] and B[i] != C[i]:
      cnt  += 1
  else:
    if A[i] != C[i]:
      cnt += 1

print(cnt)

Solution (Python):


import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N = II()
    a = input()
    b = input()
    c = input()
    ans = 0
    for i in range(N):
        C = Counter([a[i], b[i], c[i]]).most_common(1)[0][1]
        if C == 1: ans += 2
        elif C == 2: ans += 1
    return ans


if __name__ == "__main__":
    print(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()

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

Solution (Python):
N = int(input())
As = input()
Bs = input()
Cs = input()

ans = 0
for A, B, C in zip(As, Bs, Cs):
    if A == B == C:
        pass
    elif A == B or B == C or C == A:
        ans += 1
    else:
        ans += 2
print(ans)

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

s = 0

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

print(s)

Solution (Python):
n = int(input())
s = [input() for i in range(3)]
c = 0
for i in range(len(s[0])):
    if s[0][i] == s[1][i] == s[2][i]:
        continue;
    if s[0][i] == s[1][i] or s[1][i] == s[2][i] or s[2][i] == s[0][i]:
        c+=1
    else :
        c+=2
print(c)

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

count = 0

def match_func(x, y, z):
  if x == y and y == z:
    return 0
  elif x == y:
    return 1
  elif y == z:
    return 1
  elif x == z:
    return 1
  else:
    return 2

for i in range(n):
  count += match_func(a[i], b[i], c[i])

print(count)

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

d = []
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 (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 x in range(N):
    aa = A[x]
    bb = B[x]
    cc = C[x]
    s = {aa, bb, cc}
    cnt = cnt + (len(s) - 1)

print(cnt)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
a = 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]:
        a += 2
    else:
        a += 1

print(a)

Solution (Python):
def nikkei2019_qual_b():
    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 b[i] == c[i] or c[i] == a[i]:
            count += 1
        else:
            count += 2

    print(count)


nikkei2019_qual_b()

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

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]:
        continue
    if 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 = list(input())
b = list(input())
c = list(input())

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

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 and y == z):
        pass
    elif (x == y or y == z or z == x):
        ans += 1
    else:
        ans += 2

print(ans)

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

counter = 0

for i in range(N):
    if A[i] != B[i] and A[i] != C[i] and B[i] != C[i]:
        counter += 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]:
        counter += 1

print(counter)

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

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

counter = 0

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

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

count = 0
for a,b,c in zip(A,B,C):
    if a == b == c:
        continue
    if a != b:
        if a == c:
            count += 1
        else:
            if b == c:
                count += 1
            else:
                count += 2
    else:
        count += 1
print(count)

Solution (Python):
n=int(input())
A=list(input())
B=list(input())
C=list(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 = list(str(input()))
b = list(str(input()))
c = list(str(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 = str(input())
B = str(input())
C = str(input())

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


print(ans)

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

score=0
for i in range(N):
    chas=[]
    chas.append(A[i])
    chas.append(B[i])
    chas.append(C[i])
    lens=len(list(set(chas)))
    score+=(lens-1)

print(score)

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    A = read_func().strip()
    B = read_func().strip()
    C = read_func().strip()
    count = 0
    for i in range(N):
        a = A[i]
        b = B[i]
        c = C[i]
        if a != b and b != c and a != c:
            count += 2
        elif a == b and a == c and b == c:
            count += 0
        else:
            count += 1
    print count


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

print(ans)

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:
		if b==c:
			continue
		else:
			ans+=1
	else:
		if a==c:
			ans+=1
		elif b==c:
			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):
    ret = 0
    if a[i] != b[i] :
        ret+=1
    if b[i] != c[i] :
        ret+=1
    if c[i] != a[i]:
        ret+=1
    if ret % 3 != 0 :
        cnt+=1
    elif ret == 3:
        cnt+=2


print(cnt)

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

for i in range(n):
    li = []
    li.append(a[i])
    li.append(b[i])
    li.append(c[i])
    ans += len(set(li))-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] and b[i] == c[i] and c[i] == a[i]:
        continue
    else:
        if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
            count += 1
        else:
            count += 2
print(count)

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

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

Solution (Python):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    n = int(input())
    a = input()
    b = input()
    c = input()
    count = 0
    for i in range(n):
        if a[i] == b[i] == c[i]:
            count+=0
        elif a[i] == b[i]:
            count+=1
        elif a[i] == c[i]:
            count+=1
        elif b[i] == c[i]:
            count+=1
        else:
            count+=2
    print(count)

Solution (Python):
n = input()
a = input()
b = input()
c = input()
cnt = 0
for i,j,k in zip(a,b,c):
    if i == k:
        pass
        if i == j:
            pass
        else:
            cnt += 1
    else:
        cnt += 1
        if i == j:
            pass
        else:
            if j == k:
                pass
            else:
                cnt += 1
print(cnt)

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

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

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

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

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

print(res)

Solution (Python):
def main():
    N = int(input())
    A = input()
    B = input()
    C = input()
    retval = 0
    for i in range(N):
        diff = 0
        if A[i] != B[i]:
            diff += 1
        if B[i] != C[i]:
            diff += 1
        if C[i] != A[i]:
            diff += 1
        if diff >= 1:
            retval += diff - 1
    print(retval)


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

Solution (Python):
N = int(input())
ABC = [input() for i in range(3)]
ans = 0
for i in range(N):
    a = ABC[0][i]
    b = ABC[1][i]
    c = ABC[2][i]
    if a == b and b == c:
        continue
    if a != b and a != c and b != c:
        ans += 2
        continue
    ans += 1
print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for k in range(N):
    a, b, c = A[k], B[k], C[k]
    if a == b == c:
        ans += 0
    elif a == b and b != c:
        ans += 1
    elif a == c and c != b:
        ans += 1
    elif b == c and b != a:
        ans += 1
    else:
        ans += 2

print(ans)

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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

ans = 0
for i in range(N):
    a, b, c = A[i], B[i], C[i]
    
    
    if a == b and b == c and c == a:
        ()
    elif a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2
print(ans)