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



Sample input:
4
west
east
wait


Sample output:
3

Submission status: Wrong Answer

Solution code:
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[0][i]]))-1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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]:
    d+=1
  else:
    d+=2
print(d)

Submission status: Wrong Answer

Solution code:
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] == c[i] == d[i]:
        count += 1
    else:
        count += 2
print(count)

Submission status: Wrong Answer

Solution code:
n=open(0).read()
p=int(n[0])+1
ans=0
for i in range(1,p+1):
  ans+=len({n[i],n[p+i],n[p*2+i]})-1
print(ans)

Submission status: Wrong Answer

Solution code:
n=open(0).read()
p=int(n[0])
ans=0
for i in range(p):
  ans+=len({n[i],n[p+i],n[p*2+i]})-1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    if not (a[i] == b[i] and b[i] == c[i]):
        ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    S = [input() for _ in range(3)]
    ans = float('inf')
    for i in range(3):
        cnt = 0
        for j in range(3):
            if i == j:
                continue
            for k in range(N):
                flag = False
                if k == 0:
                    if S[i][k] != S[j][k]:
                        cnt += 1
                else:
                    if S[i][k] != S[i-1][k]:
                        flag = False
                        if S[i][k] != S[j][k]:
                            cnt += 1
                    else:
                        if not flag and S[i][k] != S[j][k]:
                            cnt += 1
                            flag = True

        ans = min(cnt, ans)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

      elif A[i] != B[i]:
        ans += 1

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

      elif B[i] != C[i]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
week=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod_,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod_-2,mod_)*pow(fac[r],mod_-2,mod_))%mod_
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
#################################### ########
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
###################################################
def main():
    N=int(input())
    A=input()
    B=input()
    C=input()
    ans=0
    for a in range(N):
        s=A[a]+B[a]+C[a]
        length=len(set(s))
        ans=length-1
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
cnt = [0,0,0]
for i in range(n):
    c1,c2,c3=0,0,0

    if b[i] !=a[i] :
        c1=1

    if c[i]!=b[i]:
        c2=1
    if c[i]!=a[i]:
        c3=1

    cnt[0] +=c1+c3
    cnt[1] +=c2+c3
    cnt[2] +=c1+c2

print(min(cnt))

Submission status: Wrong Answer

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

cnt = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        cnt += 1

print(n-cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input();b=input();c=input()
x=[0,0,0]
for i in range(n):
  if a[i]!=b[i]:
    x[0]+=1
  if b[i]!=c[i]:
    x[1]+=1
  if c[i]!=a[i]:
    x[2]+=1
x.sort()
print(x[0]+x[1])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input();b=input();c=input()
ab=0;bc=0;ca=0
for i in range(n):
  if a[i]!=b[i]:
    ab+=1
  if b[i]!=c[i]:
    bc+=1
  if c[i]!=a[i]:
    ca+=1
print(min(ab,bc,ca))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a, b, c = input(), input(), input()
ax, bx, cx = 0, 0, 0
for i in range(n):
  if a[i] != b[i]:
    ax += 1
    bx += 1
  if b[i] != c[i]:
    bx += 1
    cx += 1
  if c[i] != a[i]:
    cx += 1
    ax += 1
print(min(ax, bx, cx))

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

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

ans = 0
for a,b,c in zip(A, B, C):
    if a == b and b == c:
        continue
    elif a != b and b != c and a != c:
        ans += 3
    else:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a,b,c = sys.stdin
count = 0
for i in range(n):
  if a[i] == b[i] == c[i]:
    continue
  elif a[i] == b[i] or a[i] == b[i] or b[i] == c[i]:
    count += 1
  else:
    count += 2
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = str(input())
b = str(input())
c = str(input())
cnt = 0
for x in range(n):
        if a[x:x+1] == b[x:x+1] == c[x:x+1]:
                break
        elif a[x:x+1] != b[x:x+1] != c[x:x+1]:
                cnt += 2
        else:
                cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = str(input())
b = str(input())
c = str(input())
cnt = 0
for x in range(n):
        if a[x:x+1] == b[x:x+1] or b[x:x+1] == c[x:x+1] or a[x:x+1] == c[x:x+1]:
                cnt += 1
        elif a[x:x+1] != b[x:x+1] != c[x:x+1]:
                cnt += 2
print(cnt)

Submission status: Wrong Answer

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

A_match = [0] * N
B_match = [0] * N
C_match = [0] * N

for i in range(N):
    if A[i] == B[i]:
        A_match[i] = B_match[i] = 1
    if A[i] == C[i]:
        A_match[i] = C_match[i] = 1
    if B[i] == C[i]:
        B_match[i] = C_match[i] = 1

sum_ABC = sum(A_match) + sum(B_match) + sum(C_match)
ans = N * 3 - sum_ABC

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[input() for _ in range(3)]
ans=0
for i in range(n):
  if arr[0][i]==arr[1][i] and arr[1][i]==arr[2][i]:
    tmp=0
  elif arr[0][i]==arr[1][i] or arr[1][i]==arr[2][i] or arr[2][i]==arr[0][i]:
    tmp=1
  else:
    tmp=0
  ans+=tmp
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().strip()
b = input().strip()
c = input().strip()
ans = 0
for _a, _b, _c in zip(a, b, c):
  if _a != _b and _b != _c:
    ans += 2
  elif _a == _b and _b == _c:
    continue
  else:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 += 2
    else:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
    if (A[i] is B[i]) & (A[i] is C[i]):
        ans += 0
    elif (A[i] is B[i]) | (B[i] is C[i]) | (A[i] is C[i]):
        ans += 1
    else:
        print(A[i],B[i],C[i]," ")
        ans += 2
print(ans)

Submission status: Wrong Answer

Solution code:
int(input())
a = str(input())
b = str(input())
c = str(input())
def f(a,b,c):
    ans = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            ans += 1
        if a[i] != c[i]:
            ans += 1
    return ans
ans = min(f(a,b,c),f(b,c,a),f(c,a,b))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    if A[s] and B[s]:
        litter.append(A[s])
    elif A[s] and C[s]:
        litter.append(A[s])
    elif B[s] and C[s]:
        litter.append(B[s])
    else:
        litter.append(A[s])
    if litter[s] != A[s]:
        c+=1
    if litter[s] != B[s]:
        c+=1
    if litter[s] != C[s]:
        c+=1
print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    if A[s] and B[s]:
        litter.append(A[s])
    elif A[s] and C[s]:
        litter.append(A[s])
    else:
        litter.append(B[s])
    if litter[s] != A[s]:
        c+=1
    if litter[s] != B[s]:
        c+=1
    if litter[s] != C[s]:
        c+=1
print(c)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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
print(n - count)

Submission status: Wrong Answer

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

print(a,b,c)

ans=0

for i in range(n):

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

print(ans)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input().strip())
a = input().strip()
b = input().strip()
c = input().strip()
r = 0    
for i in range(n):
  if a[i] != b[i]:
    r = r+1
  if a[i] != c[i]:
    r = r+1
print (str(r))

Submission status: Wrong Answer

Solution code:
n = int(input().strip())
a = input().strip()
b = input().strip()
c = input().strip()
r = 0    
for i in range(n):
  if a[i] != b[i]:
    r = r+1
    if a[i] != c[i]:
      r = r+1
print (str(r))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
c=input()
d = input()
count = 0
for i in range(len(b)+1):
    i=i-1
    if b[i] == c[i] == d[i]:
        count= 0 + count
    if b[i] == c[i] and b[i]!=d[i] :
        count =1+ count
    if b[i] == d[i] and b[i]!=c[i]:
        count =1+count
    if b[i]!=c[i] and b[i]!=d[i]:
        count = count +2
    if c[i] ==d[i] and c[i] != b[i]:
        count = count+1

print(str(count))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import sys
import math

n = int(input())

s = []

for i in range(3):
    s.append(input())

num = []
for i in range(3):
    num2 = []
    for j in range(3):
        max_n = 0
        if i != j:
            for k in range(len(s[0])):
                if s[i][k] != s[j][k]:
                    max_n += 1
        num2.append(max_n)
    num.append(num2)
#print(num)


print(min([sum(u) for u in num]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input()
b=input()
c=input()
abc=list('0'*n)
for i in range(n):
    if a[i]==b[i]:
        abc[i]=a[i]
    if b[i]==c[i]:
        abc[i]=b[i]
    if c[i]==a[i]:
        abc[i]=c[i]
count=0
for i in range(n):
    if a[i]!=abc[i]:
        count+=1
    if b[i]!=abc[i]:
        count+=1
    if c[i]!=abc[i]:
        count+=1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input()
B = input()
C = input()
count = 0

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

print(count)

Submission status: Wrong Answer

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

count = 0
countA=countB=0

for i in range(N):
    if not A[i]==B[i]:
        countA +=1
    if not B[i]==C[i]:
        countB +=1
print(countA,countB)
if countA > countB:
    for i in range(N):
        if not C[i]==B[i]:
            count += 1
        if not C[i]==A[i]:
            count += 1
if countA < countB:
    for i in range(N):
        if not A[i]==C[i]:
            count += 1
        if not A[i]==B[i]:
            count += 1
else:
    for i in range(N):
        if not B[i]==A[i]:
            count +=1
        if not B[i]==C[i]:
            count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
A = input()
B = input()
C = input()
count = 0

for a in A:
  if a not in B:
    count += 1
for a in A:
  if a not in C:
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n, a, b, c = [input() for i in range(4)]
n = int(n)

ret = 0
for i in range(n):

    if (a[i] == b[i]) and (a[i] == c[i]):

        pass
    elif (a[i] == b[i]) and (a[i] != c[i]):

        c = c[:i] + a[i] + c[i + 1:]
        ret += 1

    elif a[i] == c[i] and a[i] != b[i]:
        b = b[:i] + a[i] + b[i + 1:]
        ret += 1

    elif a[i] != b[i] and a[i] != c[i]:
        b = b[:i] + a[i] + b[i + 1:]
        c = c[:i] + a[i] + c[i + 1:]
        ret += 2


print(ret)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
S.append([c for c in input()])
S.append([c for c in input()])
S.append([c for c in input()])

ANS=100
for i in range(3):
    count=0
    for j in range(3):
        if i == j: continue
        for c in range(N):
            if S[i][c] != S[j][c]: count += 1
    if ANS > count: ANS = count

count = 0
for i in range(N):
    if S[0][i] == S[1][i] and S[1][i] == S[2][i]: continue
    elif S[0][i] == S[1][i] or S[1][i] == S[2][i] or S[0][i] == S[2][i]: count += 1
    else: count += 2

ANS = min(ANS, count)

print(ANS)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
d = 0
for i in range(0, n):
  if a[i:i+1] != b[i:i+1] and b[i:i+1] != c[i:i+1] and a[i:i+1] != c[i:i+1]:
    d += 2
  if a[i:i+1] == b[i:i+1] and b[i:i+1] == c[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 0
  if a[i:i+1] != b[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != b[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != c[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if b[i:i+1] != c[i:i+1] and b[i:i+1] == a[i:i+1]:
    d += 1
  if b[i:i+1] != c[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 1
print(d)

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

str_len = len(A)

count = 0


for i in range(str_len):
    if A[i]==B[i]:
        if C[i]==B[i]:
            continue
        else:
            count = count + 1
    elif A[i]==C[i]:
        count = count + 1
    else:
        count = count + 2

Submission status: Wrong Answer

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

a = list(A)
b = list(B)
c = list(C)

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
d = 0
for i in range(0, n):
  if a[i:i+1] != b[i:i+1] != c[i:i+1]:
    d += 2
  if a[i:i+1] == b[i:i+1] == c[i:i+1]:
    d += 0
  if a[i:i+1] != b[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != b[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != c[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if b[i:i+1] != c[i:i+1] and b[i:i+1] == a[i:i+1]:
    d += 1
  if b[i:i+1] != c[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 1
print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
d = 0
for i in range(0, n):
  if a[i:i+1] != b[i:i+1] != c[i:i+1]:
    d += 2
  if a[i:i+1] == b[i:i+1] == c[i:i+1]:
    d += 0
  if a[i:i+1] != b[i:i+1] and a[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != b[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != c[i:i+1] and b[i:i+1] == c[i:i+1]:
    d += 1
  if a[i:i+1] != c[i:i+1] and a[i:i+1] == b[i:i+1]:
    d += 1
print(d)

Submission status: Wrong Answer

Solution code:
print("Enter Data: ")
n = int(input().strip())
a = input().strip()
b = input().strip()
c = input().strip()
r = 0    
for i in range(n):
  if a[i] != b[i]:
    r = r+1
    if a[i] != c[i]:
      r = r+1
print (str(r))

Submission status: Wrong Answer

Solution code:
import collections

N = int(raw_input())
moji = []
moji.append(raw_input())
moji.append(raw_input())
moji.append(raw_input())

print moji
count = 0


for i in range(N):
	row = [moji[0][i],moji[1][i],moji[2][i]]
	count += 3 - collections.Counter(row).most_common()[0][1]

print count

Submission status: Wrong Answer

Solution code:
N = int(input())

a = []
b = []
c = []

a = list(input())

b = list(input())

c = list(input())


#c = list(map(str, input().split("")))

#print(a)
#print(b)
#print(c)

sou = 0
kaisu =0

for i in range(N):
    if a[i] == b[i] == c[i]:
        kaisu =0
    if a[i] !=b[i] == c[i]:
        kaisu=1
    if a[i] == b[i] != c[i]:
        kaisu = 1
    if a[i] != b[i] != c[i]:
        kaisu=2
    sou = sou + kaisu

print(sou)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
d = 0
for i in range(0, n):
  if a[i] != b[i] != c[i]:
    d += 2
  if a[i] == b[i] == c[i]:
    d += 0
  if a[i] != b[i] and a[i] == c[i]:
    d += 1
  if a[i] != b[i] and b[i] == c[i]:
    d += 1
  if a[i] != c[i] and b[i] == c[i]:
    d += 1
  if a[i] != c[i] and a[i] == b[i]:
    d += 1
print(d)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(input())
B = list(input())
C = list(input())
A.sort
B.sort
C.sort
count = 0
for i in range(N):
    if not (A[i]==B[i])&(B[i]==C[i]):
        count +=1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = str(input())
b = str(input())
c = str(input())
ans = 0
list1 = []
for i in range(n):
    list1.append(a[i])
    list1.append(b[i])
    list1.append(c[i])
    set1 = set(list1)
    ans += len(set1)-1
    list = []
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input()
b = input()
c = input()
d = 0
for i in range(0, n):
  if a[i] != b[i] != c[i]:
    d += 2
  else:
    if a[i] == b[i] == c[i]:
      d += 0
    else:
      d += 1

print(d)

Submission status: Wrong Answer

Solution code:
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    countb = 0
    countc = 0
    for i in range(n):
        if a[i] != b[i]:
            counta += 1
    for i in range(n):
        if a[i] != c[i]:
            countb += 1
    for i in range(n):
        if b[i] != c[i]:
            countc += 1
    return counta + countb + countc - max(counta,countb,countc)

def output():
    res = answer()
    print(res)
output()

Submission status: Wrong Answer

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

for idx in range(N):
    if A[idx] == B[idx] and A[idx] == C[idx] and B[idx] == C[idx]:
        print(0)
        continue
    elif A[idx] == B[idx]:
        C = C[:idx] + A[idx] + C[idx+1:]
        cnt += 1
    elif A[idx] == C[idx]:
        B = B[:idx] + A[idx] + B[idx+1:]
        cnt += 1
    elif B[idx] == C[idx]:
        A = A[:idx] + B[idx] + A[idx+1:]
        cnt += 1
    else:
        B = B[:idx] + A[idx] + B[idx+1:]
        C = C[:idx] + A[idx] + C[idx+1:]
        cnt += 2
#print(A,B,C)
print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

cnt = 0

for i in range(N):
    if A[i] != B[i]:
        cnt+=1

for i in range(N):
    if A[i] != C[i]:
        cnt+=1

print("{}".format(cnt))