jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define int long long
int inf = 10e17;
#define mod 1000000007
int findLowerBound(
    vector<pair<int, int>> &arr,
    pair<int, int> &p)
{

    auto low = lower_bound(arr.begin(),
                           arr.end(), p);

    return low - arr.begin();
}
int findUpperBound(
    vector<pair<int, int>> &arr,
    pair<int, int> &p)
{
    auto up = upper_bound(arr.begin(),
                          arr.end(), p);

    return up - arr.begin();
}
bool vis[200005];
vector<int> vec[2000005];
int child[2000005];
int parent[2000005];
int div1[100005];
void dfs(int node)
{
    vis[node] = 1;
    for (int i = 0; i < vec[node].size(); i++)
    {
        if (!vis[vec[node][i]])
        {
            parent[vec[node][i]] = node;
            dfs(vec[node][i]);
            //   child[node] += child[vec[node][i]];
        }
    }
}
void bfs(int node)
{
    queue<int> qu;
    qu.push(node);
    vis[1] = 1;
    while (!qu.empty())
    {
        int top = qu.front();
        //cout << qu.front() << "\n";
        qu.pop();
        vis[top] = 1;
        for (int i = 0; i < vec[top].size(); i++)
        {
            if (!vis[vec[top][i]])
            {
                parent[vec[top][i]] = top;
                qu.push(vec[top][i]);
                vis[vec[top][i]] = 1;
            }
        }
    }
}
void belman(int n, int m, vector<pair<int, pair<int, int>>> vec, int dis[])
{
    for (int i = 0; i <= n + m - 1; i++)
    {
        for (int j = 0; j < vec.size(); j++)
        {
            int u = vec[j].second.first;
            int v = vec[j].second.second;
            int w = vec[j].first;

            if (dis[u] + w < dis[v])
            {
                dis[v] = dis[u] + w;
            }
        }
    }
}
int fun(int a, int b)
{
    if (a > b)
        return 0;
    if (a == b)
        return 1;
    else
    {
        return fun(a + 1, b) + fun(a, b - a);
    }
}
int32_t main()
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);

    int a, b;
    cin >> a >> b;
    if ((a + b) % 2)
    {
        cout << (a + b) / 2 + 1 << "\n";
    }
    else
    {
        cout << (a + b) / 2 << "\n";
    }

    return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int a,b;
  scanf("%d%d", &a, &b);
  printf("%d\n", (a+b+1)/2);
  
  return 0;
}
//  [c]
#include<stdio.h>

int main()
{
  int a,b,c;
  scanf("%d%d",&a,&b);
  c=(a+b+1)/2;
  printf("%d\n",c);
  return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  a+=b;
  if(a%2==0) a/=2;
  else a=a/2+1;
  printf("%d\n",a);
  return 0;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {

  var inp = input.split(" ");
  var a = parseInt(inp[0]);
  var b = parseInt(inp[1]);
  var c = Math.ceil((a + b) / 2);
  console.log('%d', c);

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const a = input.split(" ").map(Number);
  console.log(Math.ceil((a[0]+a[1])/2));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
	input = input.split(" ");
	
	var a = parseInt(input[0], 10);
	var b = parseInt(input[1], 10);
	
    console.log("%d", Math.ceil((a + b) / 2));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
)

func main() {
  var a, b, x float64
  fmt.Scanf("%f %f", &a, &b)
  
  x = (a + b) / 2
  ans := int(x)
  if x - float64(ans) > 0 {
    ans++
  }
  
  fmt.Printf("%d\n", ans)
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {

	var a, b float64
	fmt.Scan(&a, &b)
	fmt.Println(math.Ceil((a + b) / 2))
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if (a+b)%2 == 1 {
		fmt.Println((a+b)/2 + 1)
	} else {
		fmt.Println((a+b)/2 + 0)
	}
}
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end
a,b = gi

puts ((a+b).to_f/2).ceil
//  [ruby]
a,b = gets.split.map(&:to_i)
puts ((a+b)/2.0).ceil
//  [ruby]
a, b = gets.chomp.split(" ").map(&:to_i)
ans = a + b
if ans % 2 == 1
    ans += 1
end
puts ans / 2
//  [rust]
use proconio::input;
fn main() {
    input!{
        a:i32,
        b:i32
    }
    println!("{}",(a+b+1)/2);
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:usize,
    b:usize,
    }
    println!("{}",(a+b+1)/2)
}
//  [typescript]
import * as fs from "fs";

let input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [a, b] = input[0].split(" ").map((x: string): number => +x);

console.log(Math.ceil((a + b) / 2));
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [a, b] = input[0].map(Number);

  return Math.ceil((a + b) / 2);
};

console.log(main(read()));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  console.log(Math.ceil((a+b)/2));
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
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
# MOD = 998244353

A, B, C = list(map(int, sys.stdin.buffer.readline().split()))
A, B = B, A
A, C = C, A
print(A, B, C)
//  [python]
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

#  = input()
#  = int(input())
X, Y, Z = map(int, input().split())
print(Z, X, Y)
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()
//  [python]
import sys
import numpy as np
# for AtCoder
import fractions
from collections import deque 
from functools import reduce

x, y, z = map(int, input().split())
x, y = y, x
x, z = z, x
print(x, y, z)
//  [java]
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] n = new int[3];
		Arrays.setAll(n, i -> sc.nextInt());
		System.out.println(n[2] + " " + n[0] + " " + n[1]);
		
	}
}
//  [java]
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt(), y = sc.nextInt(), z = sc.nextInt();
    int tmp = y;
    y = x;
    x = z;
    z = tmp;
    System.out.println(x + " " + y + " " + z);
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int X = scan.nextInt();
        int Y = scan.nextInt();
        int Z = scan.nextInt();
        int t = X;
        X = Y;
        Y = t;
        t = X;
        X = Z;
        Z = t;
        System.out.printf("%d %d %d\n", X, Y, Z);

    }
}
//  [cpp]
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int MOD=1000000007;

int main(){
    ll x,y,z;
    cin>>x>>y>>z;
    cout<<z<<" "<<x<<" "<<y<<endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#include <math.h> 
#include<stdio.h>
#include<string.h> //strcmp、strncmp関数を使うために必要
#include <sstream>


int main(){
    int X,Y,Z;
    int x,y,z;
    cin >> X >> Y >> Z;
    
    x = X;
    y = Y;
    z = Z;
    
    X = y;
    Y = x;
    X = z;
    Z = y;
    
    

        cout <<X<< " " << Y << " " << Z << endl;
    
    

    
}
//  [c]
#include <stdio.h>

int main (){
  int a,b,c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d %d %d\n", c,a,b);
  return 0;
}
//a,b,c
//b,a,c
//c,a,b
//  [c]
#include<stdio.h>

int main(){
   int X,Y,Z;
   int tmp;

   scanf("%d %d %d",&X,&Y,&Z);
   tmp = X;
   X = Y;
   Y = tmp;
   tmp = X;
   X = Z;
   Z = tmp;

   printf("%d %d %d\n",X,Y,Z);

   return 0;
}
//  [c]
#include <stdio.h>
 
int main(void){
  int X, Y, Z;
  scanf("%d %d %d", &X, &Y, &Z);
  printf("%d %d %d\n", Z, X, Y);
}
//  [javascript]
function Main(input) {
    var X = input[0];
    var Y = input[1];
    var Z = input[2];

    console.log(`${Z} ${X} ${Y}`);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));
//  [javascript]
"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var processData = function processData(lines) {
  var t;

  var _lines$0$split = lines[0].split(' '),
      _lines$0$split2 = _slicedToArray(_lines$0$split, 3),
      a = _lines$0$split2[0],
      b = _lines$0$split2[1],
      c = _lines$0$split2[2];

  t = b;
  b = a;
  a = t;
  t = c;
  c = a;
  a = t;
  console.log(a, b, c);
};

var i = '';
process.stdin.on('data', function (c) {
  return i += c;
});
process.stdin.on('end', function () {
  var _require = require('os'),
      EOL = _require.EOL;

  var lines = i.split(EOL);
  /*your input text, split by lines*/

  processData(lines);
});
//  [javascript]
const Main = input => {
  const input_sp = input.split(' ');
  const X = input_sp[0];
  const Y = input_sp[1];
  const Z = input_sp[2];

  console.log(`${Z} ${X} ${Y}`);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main
 
import (
	"fmt"
)
 
func main() {
	var x, y, z int
	fmt.Scanf("%d %d %d", &x, &y, &z)

	fmt.Printf("%d %d %d\n", z, x, y)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main(){
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var X, Y, Z int
	fmt.Fscan(r, &X, &Y, &Z)
	X, Y = Y, X
	X, Z = Z, X
	fmt.Println(X, Y, Z)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var x, y, z int
	_, _ = fmt.Scanf("%d %d %d", &x, &y, &z)

	fmt.Println(answer161A(x, y, z))
}

func answer161A(x int, y int, z int) string {
	return fmt.Sprintf("%d %d %d", z, x, y)
}
//  [ruby]
x,y,z = gets.chomp.split(" ").map(&:to_s);

puts z+" "+x+" "+y
//  [ruby]
a,b,c=gets.chomp.split(" ").map(&:to_i)
x=a
y=b
z=c
a=z
b=x
c=y
print "#{a} #{b} #{c}"
//  [ruby]
# frozen_string_literal: true

ary = gets.split.map(&:to_i)
temp = ary[1]
ary[1] = ary[0]
ary[0] = temp

temp = ary[2]
ary[2] = ary[0]
ary[0] = temp

puts "#{ary[0]} #{ary[1]} #{ary[2]}"
//  [rust]
use proconio::{fastout, input, marker::*};

#[fastout]
fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
    }

    let tmp = b;
    let b = a;
    let a = tmp;

    let tmp = c;
    let c = a;
    let a = tmp;

    println!("{} {} {}", a, b , c);

}
//  [swift]
import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
print(array[2], array[0], array[1])
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
var a=arr[0]
var b=arr[1]
var c=arr[2]
var x = 0
 
x = a
a = b
b = x
 
x = a
a = c
c = x
print(String(a))
print(String(b))
print(String(c))
//  [swift]
import Foundation

let input_line = readLine()!.components(separatedBy: " ")
let X = Int(input_line[0])!
let Y = Int(input_line[1])!
let Z = Int(input_line[2])!

var A = X
var B = Y
var C = Z

swap(&A, &B)
swap(&A, &C)

print("\(A) \(B) \(C)")
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc001 {

    export class Program {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        /**
         * in
         *
         * out
         *
         */
        main(): void {
            const [x, y, z]: number[] = this.args[0].split(' ').map(Number);

            //a b
            //a c
            console.log(`${z.toString()} ${x.toString()} ${y.toString()}`);

        }
    }

}

const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const prg = new AtCoder.abc001.Program(args);
prg.main();
//  [typescript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const str: string[] = inputs[0].split(' ');

  changeStr(str, 0, 1);
  changeStr(str, 0, 2);

  console.log(str.join(' '));
}

function changeStr(str: string[], index1: number, index2: number): string[] {
  let temp = str[index1];
  str[index1] = str[index2];
  str[index2] = temp;

  return str;
}
//  [python]
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
	s = set([A[i], B[i], C[i]])
	ans += len(s) - 1
print(ans)
//  [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] or B[i] == C[i] or C[i] == A[i]:
        ans += 1
    else:
        ans += 2
print( ans)
//  [python]
N = int(input())
A, B, C = input(), input(), input()
ans = 0
for a, b, c in zip(A, B, C):
    L = len(set([a, b, c]))
    if L == 3:
        ans += 2
    elif L == 2:
        ans += 1
print(ans)
//  [python]
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 27 20:47:18 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""

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

result = 0

for n in range(N):
    if A[n] == B[n] and B[n] == C[n]:
        continue
    else:
        if A[n] == B[n] or B[n] == C[n] or C[n] == A[n]:
            result += 1
        else:
            result +=2
print(result)
//  [python]
#!/Users/takahiro.kida/git/atcorder/venv/bin/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)
//  [python]
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = S()
B = S()
C = S()

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

print(cnt)
//  [java]
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {
	    int N = nextInt();
	    char[] A = nextString().toCharArray();
	    char[] B = nextString().toCharArray();
	    char[] C = nextString().toCharArray();
	    
	    int total_change = 0;
	    
	    for(int i=0; i<N; i++){
	        if(A[i] != B[i] && B[i] != C[i] && C[i] != A[i] ){
	            total_change+=2;	            
	        }else if(A[i] != B[i] || B[i] != C[i] ||  C[i] != A[i]){
	            total_change++;	            
	        }
	    }

        out.println(total_change);
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		long N = Long.parseLong(W);
		String A = in.readLine();
		String B = in.readLine();
		String C = in.readLine();

		long ans = 0;
		for(int i=0;i<N;i++){
			if(A.charAt(i)==B.charAt(i) && A.charAt(i)==C.charAt(i)){

			}else if(A.charAt(i)==B.charAt(i) || A.charAt(i)==C.charAt(i) ||B.charAt(i)==C.charAt(i)){
				ans++;
			}else{
				ans+=2;
			}
		}
		System.out.println(ans);
	}
}
//  [java]
import java.io.*;

public class Main {

  public static void main(String[] args) throws IOException {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] in = br.readLine().split(" ");
    int n = Integer.parseInt(in[0]);

    String a = br.readLine();
    String b = br.readLine();
    String c = br.readLine();

    br.close();

    int ans = 0;

    for(int i = 0; i < n; i++){
      int sameNum = 0;
      if(a.charAt(i) == b.charAt(i)) sameNum++;
      if(b.charAt(i) == c.charAt(i)) sameNum++;
      if(c.charAt(i) == a.charAt(i)) sameNum++;

      int add = 0;
      if(sameNum == 0) add = 2;
      if(sameNum == 1) add = 1;

      ans += add;
    }

    System.out.println(ans);
  }
}
//  [java]
import java.util.*;
import java.util.stream.*;

class Main{
	static Scanner s=new Scanner(System.in);
	public static void main(String[] $){
		int n=s.nextInt();
		String a=s.next();
		String b=s.next();
		String c=s.next();
		System.out.println(
				IntStream.range(0,n).mapToLong(i->Stream.of(a.charAt(i),b.charAt(i),c.charAt(i)).distinct().count()-1)
				.sum()
				);
	}
}
//  [cpp]
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <bitset>

char sl[3][128];

int main(){
  int N;
  scanf("%d %s %s %s", &N, sl[0], sl[1], sl[2]);
  int count = 0;
  for(int i = 0; i < N; i++){
    char a = sl[0][i], b = sl[1][i], c = sl[2][i];
  	if(a == b && b == c){
      continue;
    }
    if(a == b || b == c || c == a){
    	count++;
    	continue;
    }
    count += 2;
  }
  printf("%d\n", count);
  return 0;
}
//  [cpp]
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
char s[200],t[200],c[200];
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s+1);
	scanf("%s",t+1);
	scanf("%s",c+1);
	int ans=0;
	for (int i=1;i<=n;i++) 
	{
		if (s[i]==t[i]&&s[i]==c[i]) continue;
		if (s[i]!=t[i]&&s[i]!=c[i]&&t[i]!=c[i]) ans=ans+2;else ans++;
	}
	printf("%d\n",ans);
}
//  [cpp]
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;

int main(){
    int N; cin >> N;
    string A, B, C;
    cin >> A >> B >> C;
    
    int counter = 0;
    rep(i, N){
        if((A[i] != B[i] && B[i] != C[i]) && A[i] != C[i]) counter += 2;
        else if(A[i] != B[i] || (B[i] != C[i] || A[i] != C[i])) counter += 1;
    }
    cout << counter << endl;
    

    return 0;
}
//  [cpp]
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
using namespace std;

#define REP(i, n) for(int i(0); i<(int)(n);i++)
#define FOR(i, a, b) for (int i(a); i<=(int)(b); i++)

using LL = long long;
using PII = pair<int, int>;
using VI = vector<int>;

int n, ans = 0;
string a, b, c;

int main() {
    cin >> n >> a >> b >> c;
    set<char> tmp;
    REP(i, n) {
        tmp.clear();
        tmp.insert(a[i]);
        tmp.insert(b[i]);
        tmp.insert(c[i]);
        ans += (int)tmp.size() - 1;
    }
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

using i64 = int_fast64_t;
using f64 = double;

constexpr i64 INF = INT_FAST64_MAX / 2;
constexpr f64 EPS = DBL_EPSILON;

void solve() {
    i64 n;
    cin >> n;
    string a, b, c;
    cin >> a >> b >> c;

    i64 ans = 0;
    for (i64 i = 0; i < n; i++) {
        switch ((a[i] == b[i]) + (b[i] == c[i]) + (c[i] == a[i])) {
        case 0:
            ans += 2;
            break;
        case 1:
            ans += 1;
            break;
        case 3:
            ans += 0;
            break;
        }
    }

    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}
//  [cpp]
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793




int main(){
    int n;
    string a,b,c;
    cin >> n >> a >> b >> c;
    int cnt=0;
    rep(i,n){
        char aa=a.at(i);
        char bb=b.at(i);
        char cc=c.at(i);
        if(aa!=bb && aa!=cc && bb!=cc)cnt+=2;
        else if(aa==bb && aa!=cc)cnt++;
        else if(aa==cc && aa!=bb)cnt++;
        else if(bb==cc && bb!=aa)cnt++;
    }
    cout << cnt << endl;
}
//  [c]
#include<stdio.h>

int main(){
  int N;
  scanf("%d", &N);

  char A[N+1], B[N+1], C[N+1];
  scanf("%s", A);
  scanf("%s", B);
  scanf("%s", C);


  int i, c;
  c = 0;

  for(i = 0; i < N; i++){
    if(A[i] == B[i] && A[i] == C[i]) c = c;
    else if(A[i] == B[i]) c++;
    else if(B[i] == C[i]) c++;
    else if(C[i] == A[i]) c++;
    else c += 2;
  }

  printf("%d\n", c);

  return 0;
}
//  [c]
#include <stdio.h>
int main() {
	int n, ans = 0;
	char a[101], b[101], c[101];
	scanf("%d%s%s%s", &n, a, b, c);
	for (int i = 0; i < n; i++) {
		if (a[i] == b[i] && b[i] == c[i]) {
			ans += 0;
		} else if (a[i] == b[i] || b[i] == c[i] || c[i] == a[i]) {
			ans += 1;
		} else {
			ans += 2;
		}
	}
	printf("%d\n", ans);
	return 0;
}
//  [c]
#include <stdio.h>

int main(void){

  int n;
  scanf("%d", &n);
  char a[n+1], b[n+1], c[n+1];
  scanf("%s %s %s", a, b, c);
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == b[i] && b[i] == c[i]) {
      continue;
    } else if (a[i] == b[i] || b[i] == c[i] || c[i] == a[i]) {
      count++;
    } else {
      count += 2;
    }
  }
  printf("%d\n", count);

  return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
  int n,count=0;;
  char a[128],b[128],c[128];
  scanf("%d %s %s %s",&n,a,b,c);
  for(int i=0;i<n;i++){
    if(a[i]!=b[i]&&a[i]!=c[i]&&b[i]!=c[i]){
      count+=2;
    }else if(a[i]!=b[i]||a[i]!=c[i]||b[i]!=c[i]){
      count++;
    }
    //printf("%d\n",count);

  }

  printf("%d\n",count);
  return 0;
}
//  [c]
#include <stdio.h>

int main (void)
{
    int n,cnt=0;
    char a[100],b[100],c[100];
    scanf("%d",&n);
    scanf("%s",a);
    scanf("%s",b);
    scanf("%s",c);
    for(int i=0;i<n;i++)
    {
        if(a[i]==b[i])
        {
            if(b[i]==c[i])
            {
                
            }else{
                cnt++;
            }
        }else{
            if(b[i]==c[i])
            {
                cnt++;
            }else{
                if(a[i]==c[i])
                {
                    cnt++;
                }else{
                    cnt+=2;
                }
            }
        }
    }
    printf("%d\n",cnt);
    return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
	int N;
	char A[128], B[128], C[128];
	int i;
	int nakamayukie = 0;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%127s", A) != 1) return 1;
	if (scanf("%127s", B) != 1) return 1;
	if (scanf("%127s", C) != 1) return 1;
	for (i = 0; i < N; i++) {
		nakamayukie += A[i] != B[i];
		nakamayukie += A[i] != C[i] && B[i] != C[i];
	}
	printf("%d\n", nakamayukie);
	return 0;
}
//  [javascript]
function Main(input) {
  input = input.split("\n");
  N = parseInt(input[0]);
  A = input[1].split("");
  B = input[2].split("");
  C = input[3].split("");
  var ans=0;
  for(var i=0;i<N;i++){
    if(A[i]==B[i]&&A[i]==C[i]){

    }else if((A[i]==B[i]&&A[i]!=C[i])||(A[i]==C[i]&&A[i]!=B[i])||(A[i]!=B[i]&&B[i]==C[i])){
      ans++;
    }else{
      ans+=2;
    }
  }



  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]

var input = require('fs').readFileSync('/dev/stdin', 'utf8');

var list = input.split('\n');

var n = Number(list[0]);

var a = list[1].split('');

var b = list[2].split('');

var c = list[3].split('');

var num = 0;

var getIndex = (i)  => {
  if (a[i] === b[i] || b[i] === c[i] || c[i] === a[i]) {
    return true;
  }
  return false;
}

for (var j = 0; j < n; j++) {
  if (!getIndex(j)) {
    num += 2;
  } else if (a[j] === b[j] && b[j] === c[j]) {
  } else {
    num += 1;
  }
}

console.log(num);
//  [javascript]
function main(input) {
  const args = input.split('\n');
  const N = parseInt(args[0], 10);
  const A = args[1].split("");
  const B = args[2].split("")
  const C = args[3].split("")
  var count = 0
  
  for(var i = 0; i<N; i++){
    count += add(A[i],B[i],C[i])
  }
  console.log(count)
}

function add (a,b,c){
  if(a == b && b == c){
    return 0
  }else if(a == b || b == c || c == a){
    return 1
  }else{
    return 2
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input){
  var n = parseInt(input[0]);
  var a = input[1];
  var b = input[2];
  var c = input[3];
  
  var ans = 0;
  for (var i = 0; i < n; i++){
    var map = {};
    map[a[i]] = 1;
    map[b[i]] = 1;
    map[c[i]] = 1;
    ans += Object.keys(map).length - 1;
  }
  console.log(ans);
}

var input = '';

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
process.stdin.on('end', function() {
  input = input.split('\n');
  main(input);
});
//  [javascript]
var lines =　[];
var readline = require('readline');

rl = readline.createInterface({
  input: process.stdin,
  output:process.stdout
});

rl.on('line',function(x){
  lines.push(x);
});

rl.on('close',function(){
  var n=Number(lines[0]);
  var a=lines[1].split("");
  var b=lines[2].split("");
  var c=lines[3].split("");
  var count=0;

    while(1){
    for(var i = 0;i<n;i++){
      if(a[i]===b[i] && b[i]===c[i]){}
      else if(a[i]===b[i]){
        c[i]=a[i];
        count++;
      }
      else if(a[i]===c[i]){
        b[i]=a[i];
        count++;
      }
      else if(b[i]===c[i]){
        a[i]=b[i];
        count++;
      }
      else{
        a[i]=b[i];
        count++;
      }
    }
    if(a.toString() === b.toString() && b.toString() === c.toString()){break;}
  }
  console.log(count);
});
//  [javascript]
// inputに入力データ全体が入る
// 7
// zenkoku
// touitsu
// program

function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	inputList = input.split("\n");
    inputNum = parseInt(inputList[0], 10);
    firstList = inputList[1].split("");
    secondList = inputList[2].split("");
    thirdList = inputList[3].split("");
    count = 0;
    for (var i = 0; i < inputNum; i++) {
        if(firstList[i] == secondList[i] && secondList[i] == thirdList[i]) {
            continue;
        }
        if(firstList[i] == secondList[i] || secondList[i] == thirdList[i] || thirdList[i] == firstList[i]) {
            count++;
            continue;
        }
        count++;
        count++;
    }
	console.log(count);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var (
		n       int
		a, b, c string
	)
	fmt.Scan(&n, &a, &b, &c)

	ans := 0
	for i := 0; i < n; i++ {
		if a[i] != b[i] && b[i] != c[i] && c[i] != a[i] {
			ans += 2
		} else if !(a[i] == b[i] && b[i] == c[i] && c[i] == a[i]) {
			ans++
		}
	}
	fmt.Println(ans)
}
//  [go]
// ProblemURL : https://atcoder.jp/contests/nikkei2019-qual/tasks/nikkei2019_qual_b
// ---------------------------------------------
package main

import "fmt"

func main() {
	var n int
	var a, b, c string
	fmt.Scan(&n, &a, &b, &c)
	cost := 0
	for i := 0; i < n; i++ {
		if a[i] == b[i] && b[i] == c[i] {
		} else if a[i] == b[i] || b[i] == c[i] || c[i] == a[i] {
			cost += 1
		} else {
			cost += 2
		}
	}
	fmt.Println(cost)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a, b, c := next(), next(), next()
	ans := 0
	for i := 0; i < n; i++ {
		if a[i] == b[i] && b[i] == c[i] {
			continue
		}
		if a[i] == b[i] && a[i] != c[i] {
			ans++
		} else if b[i] == c[i] && c[i] != a[i] {
			ans++
		} else if c[i] == a[i] && a[i] != b[i] {
			ans++
		} else {
			ans += 2
		}
	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func max(a ...int) int {
	m := a[0]
	for i, v := range a {
		if i == 0 {
			continue
		}
		if m < v {
			m = v
		}
	}
	return m
}
func main() {
	// Code for B - Touitsu
	var N int
	var A, B, C string
	fmt.Scan(&N, &A, &B, &C)

	var ans int
	for i := 0; i < N; i++ {
		if A[i] == B[i] && B[i] == C[i] && C[i] == A[i] {
			continue
		} else if A[i] != B[i] && B[i] != C[i] && C[i] != A[i] {
			ans += 2
		} else {
			ans++
		}
	}
	fmt.Println(ans)

}
//  [ruby]
n = gets.to_i
a = gets.chomp
b = gets.chomp
c = gets.chomp
count = 0
for i in 0...n do
  if a[i] != b[i] && b[i] != c[i] && c[i] != a[i]
    count += 2
  elsif a[i] == b[i] && b[i] == c[i]
    count += 0
  else
    count += 1
  end
end
puts count
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

n=inp[0]
st = []
3.times{st<<gets.chomp}
ans = 0
n.times do |i|
  if st[0][i] == st[1][i] and st[1][i] == st[2][i]
    ans += 0
  elsif st[0][i] == st[1][i] or st[1][i] == st[2][i] or st[0][i] == st[2][i]
    ans += 1
  else
    ans += 2
  end
end
p ans
//  [ruby]
n = gets.to_i
a = gets.chomp.chars
b = gets.chomp.chars
c = gets.chomp.chars
res = 0
(0...n).each do |i|
  next if a[i] == b[i] && b[i] == c[i]
  if a[i] != b[i] && b[i] != c[i] && c[i] != a[i]
    res += 2
  else
    res += 1
  end
end
puts res
//  [ruby]
require 'set'
n,a,b,c=gets(p).split
x=0
(0...n.to_i).map{|i|x+=Set[a[i],b[i],c[i]].size-1}
p x
//  [ruby]
_, *a=`dd`.split.map &:chars
p a.transpose.map{|x|x.uniq.size-1}.inject(:+)
//  [ruby]
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=gets.to_i
A=get_nsp
B=get_nsp
C=get_nsp
ans=0
N.times do|i|
  m={}
  m[A[i]]=1
  m[B[i]]=1
  m[C[i]]=1
  ans+=m.size-1
end
puts ans
//  [rust]
#![allow(non_snake_case)]

use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let _n: usize = read();
    let a: String = read();
    let b: String = read();
    let c: String = read();

    let mut ans = 0;

    for (a, (b, c)) in a.chars().zip(b.chars().zip(c.chars())) {
        let mut abc = vec![a, b, c];
        abc.sort();
        abc.dedup();
        ans += abc.len() - 1;
    }

    println!("{}", ans);
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}
//  [rust]
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| min!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| max!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let a: String = sc.cin();
    let b: String = sc.cin();
    let c: String = sc.cin();
    put!(a.chars().zip(b.chars().zip(c.chars())).map(|(x, (y, z))| {
        if x == y && y == z {
            0
        } else if x == y || y == z || z == x {
            1
        } else {
            2
        }
    }).sum::<u64>())
        ;
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut scan = Scanner::new(cin);

    let n = scan.read::<i32>();
    let mut s = vec![vec![];3];
    for i in 0..3 {s[i] = scan.read_chars();}
    let mut t = vec![];
    for i in 0..n {
        let ith = vec![s[0][uz(i)], s[1][uz(i)], s[2][uz(i)]];
        let hmap = count(&ith);
        let m = hmap.iter().map(|(_, &k)| k).max().unwrap();
        if m == 1 {
            t.push(s[0][uz(i)]);
        } else {
            t.push(hmap.iter().filter(|&(_, &k)| k == m).map(|(&c, _)| c).collect::<Vec<char>>()[0]);

        }
    }
    let mut cnt = 0;
    for i in 0..3 {
        cnt += diffcnt(&s[i], &t);
    }
    println!("{}", cnt);
}

fn diffcnt(a: &[char], b: &[char]) -> i32 {
    let mut cnt = 0;
    for i in 0..a.len() {
        if a[i] != b[i] {cnt+=1}
    }
    cnt
}

#[allow(dead_code)]
fn count<T: Eq + std::hash::Hash + Clone>(slice: &[T]) -> std::collections::HashMap<T, usize> {
    let mut hmap = std::collections::HashMap::new();
    for item in slice {
        *hmap.entry(item.clone()).or_insert(0) += 1;
    }
    hmap
}

// region template
#[allow(dead_code)]
fn uz(i: i32) -> usize { i as usize }

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read_opt<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read_opt().unwrap()
    }

    fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:usize,
    b:String,
    c:String,
    d:String,
    }
    let mut b=b.chars().collect_vec();
    let mut c=c.chars().collect_vec();
    let mut d=d.chars().collect_vec();
    let mut e=0;
    for i in 0..b.len(){
        if b[i]==c[i]&&c[i]==d[i]{e+=0}
        else if b[i]==c[i]||c[i]==d[i]||d[i]==b[i]{e+=1}
        else{e+=2}
    }
    println!("{}",e)
}
//  [swift]
let N=Int(readLine()!)!
var line:[Character] {
  return readLine()!.characters.map{$0}
}
let S=[line,line,line]
print((0..<N).reduce(0){i,j in i+Set(S.map{$0[j]}).count-1})
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [_n, a, b, c] = stdin.trim().split('\n')

const n = Number(_n)

const ans = _ => {
  let count = 0
  for (let i = 0; i < n; i++) {
    if (a[i] !== b[i] && b[i] !== c[i] && a[i] !== c[i]) {
      count += 2
    } else if (!(a[i] === b[i] && b[i] === c[i] && a[i] === c[i])) {
      count++
    }
  }
  return count
}

console.log(ans())
//  [typescript]
function main(input) {
  const args = input.split("\n");
  const N = parseInt(args[0]);
  const A = args[1];
  const B = args[2];
  const C = args[3];
  let result = 0;
  for (let i = 0; i < N; i++) {
    // 同じ文字なら一点
    const r1 = A[i] === B[i] ? 1 : 0;
    const r2 = B[i] === C[i] ? 1 : 0;
    const r3 = C[i] === A[i] ? 1 : 0;
    switch (r1 + r2 + r3) {
      case 3:
      case 2:
        break;
      case 1:
        result += 1;
        break;
      case 0:
        result += 2;
        break;
    }
  }
  console.log(`${result}`);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
s = list(input())

while s[0] != 'A' or s[-1] != 'Z':
    if s[0] == 'A':
        s.pop()
    elif s[-1] == 'Z':
        s.pop(0)
    else:
        s.pop(0)
        s.pop()

print(len(s))
//  [python]
s = input()
w = ""
ans = ""
f = 0
for c in s:
    if c == "A":
        f = 1
    if f == 1:
        w += c
        if c == "Z":
            ans = w
ans = len(ans)
print(ans)
//  [python]
w=input()
for i in range(len(w)):
    a=w.find('A')
    b=w.rfind('Z')
print(b-a+1)
//  [java]
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] S = new String[s.length()];
        int a = -1;
        int length = 0;
        S = s.split("");

        for (int i = 0; i < s.length(); i++) {
            if (S[i].equals("A") && a == -1) {
                a = i;
            }

            if (S[i].equals("Z") && a != -1) {
                length = i - a + 1;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(length);

        sc.close();
        out.flush();
    }
}
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        //値を取得
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] str = s.split("");
        int count = 0;
        int countStart = 0;
        int countEnd = 0;
        
        //文字列を一文字ずつ取り出し、条件に合えばカウント
        //条件に合わないときは何もしない
        for (int i = 0; i < str.length; ++i){
            if (str[i].equals("A")){    //始まり
                countStart = 1;
            }
            if (countStart == 1){  //部分文字列のカウント
                ++count;
                if (str[i].equals("Z")){  //終わり
                    countEnd = count;
                }
            }
        }
        
        //出力
        System.out.println(countEnd);
        
    }
}
//  [java]
import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] S = new String[s.length()];
    int a = -1;
    int length = 0;
    S = s.split("");
    for (int i = 0; i < s.length(); i++) {
      if (S[i].equals("A") && a == -1) {
        a = i;
      }
      if (S[i].equals("Z") && a != -1) {
        length = i - a + 1;
      }
    }
    System.out.println(length);
  }
}
//  [cpp]
/* 
 * Project: AtCoder Beginners Contest 053 
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/06/11
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
#include <cstring>
using namespace std;

char s[200000];

void solve() {
    
    int cnt_a = 0;
    int cnt_z = 0;
    bool is_find_a = false;
    bool is_find_z = false;
    for (int i=0;i<strlen(s)-1;i++) {
        if (is_find_a) {
            if (is_find_z) {
                printf("%ld\n", strlen(s)-cnt_z-cnt_a);
                return;
            }
        } else if (!strncmp(&s[i], "A", 1)) {
            cnt_a = i;
            is_find_a = true;
        }
        if (is_find_z) {
            ;
        } else if (!strncmp(&s[strlen(s)-1-i], "Z", 1)) {
            cnt_z = i;
            is_find_z = true;
        }
    }
    printf("%ld\n", strlen(s)-cnt_z-cnt_a);
}

int main() {

    scanf("%s", s);

    solve();

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int z_find(string s){
  reverse(s.begin(),s.end());
  int count=0;
  for(int i=0;i<s.size();i++){
    count++;
    if(s[i]=='Z') break;
  }
  int ans =s.size()-count;
  return ans;
}

int main(){
  string s,S;
  cin >> s;
  int a=z_find(s);
  bool f = false;
  for(int i=0;i<a+1;i++){
    if(s[i]=='A') f=true;
    if(f){
      S=S+s[i];
    }
  }
  cout << S.size() << endl;
}
//  [cpp]
/* 
 * Project: AtCoder Beginners Contest 053 
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/06/11
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
#include <cstring>
using namespace std;

char s[200000];

void solve() {
    
    int cnt_a = 0;
    int cnt_z = 0;
    bool is_find_a = false;
    bool is_find_z = false;
    for (int i=0;i<strlen(s)-1;i++) {
        if (is_find_a) {
            ;
        } else if (!strncmp(&s[i], "A", 1)) {
            cnt_a = i;
            is_find_a = true;
        }
        if (is_find_z) {
            ;
        } else if (!strncmp(&s[strlen(s)-1-i], "Z", 1)) {
            cnt_z = i;
            is_find_z = true;
        }
    }
    printf("%ld\n", strlen(s)-cnt_z-cnt_a);
}

int main() {

    scanf("%s", s);

    solve();

}