You are given two strings $a$ and $b$ consisting of lowercase English letters, both of length $n$. The characters of both strings have indices from $1$ to $n$, inclusive. 

You are allowed to do the following changes:   Choose any index $i$ ($1 \le i \le n$) and swap characters $a_i$ and $b_i$;  Choose any index $i$ ($1 \le i \le n$) and swap characters $a_i$ and $a_{n - i + 1}$;  Choose any index $i$ ($1 \le i \le n$) and swap characters $b_i$ and $b_{n - i + 1}$. 

Note that if $n$ is odd, you are formally allowed to swap $a_{\lceil\frac{n}{2}\rceil}$ with $a_{\lceil\frac{n}{2}\rceil}$ (and the same with the string $b$) but this move is useless. Also you can swap two equal characters but this operation is useless as well.

You have to make these strings equal by applying any number of changes described above, in any order. But it is obvious that it may be impossible to make two strings equal by these swaps.

In one preprocess move you can replace a character in $a$ with another character. In other words, in a single preprocess move you can choose any index $i$ ($1 \le i \le n$), any character $c$ and set $a_i := c$.

Your task is to find the minimum number of preprocess moves to apply in such a way that after them you can make strings $a$ and $b$ equal by applying some number of changes described in the list above.

Note that the number of changes you make after the preprocess moves does not matter. Also note that you cannot apply preprocess moves to the string $b$ or make any preprocess moves after the first change is made.


-----Input-----

The first line of the input contains one integer $n$ ($1 \le n \le 10^5$) — the length of strings $a$ and $b$.

The second line contains the string $a$ consisting of exactly $n$ lowercase English letters.

The third line contains the string $b$ consisting of exactly $n$ lowercase English letters.


-----Output-----

Print a single integer — the minimum number of preprocess moves to apply before changes, so that it is possible to make the string $a$ equal to string $b$ with a sequence of changes from the list above.


-----Examples-----
Input
7
abacaba
bacabaa

Output
4

Input
5
zcabd
dbacz

Output
0



-----Note-----

In the first example preprocess moves are as follows: $a_1 := $'b', $a_3 := $'c', $a_4 := $'a' and $a_5:=$'b'. Afterwards, $a = $"bbcabba". Then we can obtain equal strings by the following sequence of changes: $swap(a_2, b_2)$ and $swap(a_2, a_6)$. There is no way to use fewer than $4$ preprocess moves before a sequence of changes to make string equal, so the answer in this example is $4$.

In the second example no preprocess moves are required. We can use the following sequence of changes to make $a$ and $b$ equal: $swap(b_1, b_5)$, $swap(a_2, a_4)$.

Difficulty: MEDIUM_HARD
Tags: Implementation

Starter code:

Solutions:
n = int(input())
a = list(input())
b = list(input())
p = int((n - 1) / 2)
n -= 1
ans = 0
for i in range(p + 1):
	if i == n - i:
		if a[i] != b[i]:
			ans += 1
	else:
		isAA = False
		isBB = False
		isABi = False
		isABni = False
		isABini = False
		isABnii = False
		if a[i] == b[i]:
			isABi = True
		if a[n - i] == b[n - i]:
			isABni = True
		if a[i] == b[n - i]:
			isABini = True
		if a[n - i] == b[i]:
			isABnii = True
		if a[i] == a[n - i]:
			isAA = True
		if b[i] == b[n - i]:
			isBB = True
		if isAA == False and isBB == False and (isABi == False) and (isABni == False) and (isABini == False) and (isABnii == False):
			ans += 2
		if isAA == False and isBB == False and (isABi == False) and (isABni == False) and (isABini == True) and (isABnii == False):
			ans += 1
		if isAA == False and isBB == False and (isABi == False) and (isABni == False) and (isABini == False) and (isABnii == True):
			ans += 1
		if isAA == False and isBB == False and (isABi == True) and (isABni == False) and (isABini == False) and (isABnii == False):
			ans += 1
		if isAA == False and isBB == False and (isABi == False) and (isABni == True) and (isABini == False) and (isABnii == False):
			ans += 1
		if isAA == True and isBB == False and (isABi == False) and (isABni == False) and (isABini == False) and (isABnii == False):
			ans += 2
		if isAA == False and isBB == True and (isABi == False) and (isABni == False) and (isABini == False) and (isABnii == False):
			ans += 1
		if isAA == True and isBB == False and (isABi == True) and (isABni == False) and (isABini == False) and (isABnii == True):
			ans += 1
		if isAA == False and isBB == True and (isABi == True) and (isABni == False) and (isABini == True) and (isABnii == False):
			ans += 1
		if isAA == False and isBB == True and (isABi == False) and (isABni == True) and (isABini == False) and (isABnii == True):
			ans += 1
		if isAA == True and isBB == False and (isABi == False) and (isABni == True) and (isABini == True) and (isABnii == False):
			ans += 1
print(ans)


from sys import stdin, stdout

def p(s):
	stdout.write(str(s) + '\n')

def ps(s):
	stdout.write(s + '\n')

def r():
	return stdin.readline()

def swap1(s, i, j):
	lst = list(s)
	(lst[i], lst[j]) = (lst[j], lst[i])
	return ''.join(lst)

def swap2(s, i, j):
	return ''.join((s[:i], s[j], s[i + 1:j], s[i], s[j + 1:]))

def swap3(s1, s2, i):
	lst1 = list(s1)
	lst2 = list(s2)
	(lst1[i], lst2[i]) = (lst2[i], lst1[i])
	return (''.join(lst1), ''.join(lst2))

def main():
	n = int(r())
	s1 = r()
	s2 = r()
	cnt = 0
	k = int(n / 2) + 1 if n % 2 == 1 else int(n / 2)
	for i in range(k):
		if i == n - i - 1:
			if s1[i] != s2[i]:
				cnt += 1
				break
		if s1[i] != s2[i] and s1[n - i - 1] == s2[n - i - 1]:
			cnt += 1
		elif s1[i] == s2[i] and s1[n - i - 1] != s2[n - i - 1]:
			cnt += 1
		elif s1[i] != s2[i] and s1[n - i - 1] != s2[n - i - 1]:
			if s1[i] == s1[n - i - 1] and s2[i] == s2[n - i - 1]:
				continue
			elif s1[i] == s2[n - i - 1] and s2[i] == s1[n - i - 1]:
				continue
			elif s1[i] == s1[n - i - 1]:
				if s2[i] != s2[n - i - 1]:
					cnt += 2
				else:
					cnt += 1
			elif s2[i] == s2[n - i - 1]:
				cnt += 1
			elif s1[n - i - 1] == s2[i] or s1[i] == s2[n - i - 1]:
				cnt += 1
			else:
				cnt += 2
	p(cnt)
main()


n = int(input())
a = list(input())
b = list(input())
temp = []
count = 0
for i in range((n + 1) // 2):
	temp = [a[i], b[i], a[n - 1 - i], b[n - 1 - i]]
	tems = list(set(temp))
	c = len(tems)
	if c == 4:
		count += 2
	elif c == 2:
		if i == n - 1 - i:
			count += 1
		elif temp.count(tems[0]) == 1 or temp.count(tems[1]) == 1:
			count += 1
	elif c == 3:
		if a[i] == a[n - 1 - i]:
			count += 2
		elif b[i] == b[n - 1 - i]:
			count += 1
		else:
			count += 1
print(count)


from collections import Counter

def main():
	n = int(input())
	a = input()
	b = input()
	(a1, b1) = (a[::-1], b[::-1])
	n2 = n // 2
	if n % 2 and a[n2] != b[n2]:
		res = 1
	else:
		res = 0
	for i in range(n2):
		(ai, a1i) = (a[i], a1[i])
		(bi, b1i) = (b[i], b1[i])
		if bi == b1i:
			if ai != a1i:
				res += 1
			continue
		cnt1 = Counter((ai, a1i))
		cnt2 = Counter((bi, b1i))
		res += sum((cnt1 - cnt2).values())
	print(res)
main()


from collections import Counter

def main():
	n = int(input())
	(s1, s2) = (input().strip(), input().strip())
	ans = 0
	for i in range(n // 2):
		c = Counter()
		c[s1[i]] += 1
		c[s2[i]] += 1
		c[s1[n - i - 1]] += 1
		c[s2[n - i - 1]] += 1
		values = sorted(c.values(), reverse=True)
		if values == [3, 1]:
			ans += 1
		elif values == [2, 1, 1]:
			ans += 1 + (s1[i] == s1[n - i - 1])
		elif values == [1, 1, 1, 1]:
			ans += 2
	if n % 2 == 1 and s1[n // 2] != s2[n // 2]:
		ans += 1
	print(ans)
main()


n = int(input())
a = input()
b = input()
x = []
y = []
p = 0
for j in range(n):
	x.append(a[j])
	y.append(b[j])
j = 0
while j <= n // 2 - 1:
	e = [x[j], x[n - 1 - j]]
	f = [y[j], y[n - 1 - j]]
	if len(set(e)) == 1 and len(set(f)) == 1:
		pass
	elif len(set(f)) == 1:
		p += 1
	else:
		if x[j] in f:
			k = f.index(x[j])
			del f[k]
			pass
		else:
			p += 1
		if x[n - j - 1] in f:
			pass
		else:
			p += 1
	j += 1
if n % 2 != 0:
	if x[n // 2] == y[n // 2]:
		pass
	else:
		p += 1
print(p)


n = int(input())
a = input()
b = input()
count = 0
for i in range(n // 2):
	if a[i] == b[i]:
		if a[n - i - 1] != b[n - i - 1]:
			count += 1
	elif a[i] == b[n - i - 1]:
		if a[n - i - 1] != b[i]:
			count += 1
	elif a[i] == a[n - i - 1]:
		if b[i] != b[n - i - 1]:
			count += 2
	elif a[n - i - 1] == b[n - i - 1]:
		count += 1
	elif a[n - i - 1] == b[i]:
		count += 1
	elif a[i] != b[i] and a[i] != b[n - i - 1] and (a[i] != a[n - i - 1]) and (b[i] != a[n - i - 1]) and (b[i] != b[n - i - 1]) and (a[n - i - 1] != b[n - i - 1]):
		count += 2
	else:
		count += 1
if n % 2 != 0:
	if a[n // 2] != b[n // 2]:
		count += 1
print(count)


n = int(input())
a = input()
b = input()
count = 0
for i in range(n // 2):
	d = {}
	for c in [a[i], a[n - i - 1], b[i], b[n - i - 1]]:
		d[c] = d.get(c, 0) + 1
	if a[i] == a[n - i - 1] == b[i] == b[n - i - 1]:
		continue
	count += 2
	if a[i] == a[n - i - 1] and b[i] != b[n - i - 1] and (a[i] != b[i]) and (a[i] != b[n - i - 1]):
		continue
	for v in d.values():
		if v >= 2:
			count -= 1
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	count += 1
print(count)


input()
(a, b) = ([], [])
for i in input():
	a.append(i)
for i in input():
	b.append(i)
(l, r) = (0, len(a) - 1)
ans = 0
while l < r:
	ji = 0
	if a[l] == b[l] or a[r] == b[r] or a[l] == b[r] or (a[r] == b[l]) or (b[l] == b[r]):
		ji = 1
	if a[l] == b[l] and a[r] == b[r] or (a[l] == b[r] and a[r] == b[l]):
		ji = 2
	if b[l] == b[r] and a[r] == a[l]:
		ji = 2
	ans += 2 - ji
	l += 1
	r -= 1
if l == r and a[l] != b[l]:
	ans += 1
print(ans)


n = int(input())
a = input()
b = input()
res = 0
for i in range(n // 2):
	(x, y, z, w) = (a[i], b[i], a[n - i - 1], b[n - i - 1])
	if x == y and z == w or (x == z and y == w) or (x == w and y == z):
		continue
	elif x == y or x == w or z == y or (z == w) or (y == w):
		res += 1
	else:
		res += 2
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		res += 1
print(res)


import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	c = dict(Counter(l))
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieveForSmallestPrimeFactor():
	MAXN = 100001
	spf = [0 for i in range(MAXN)]
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, math.ceil(math.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
	return spf

def getPrimeFactorizationLOGN(x):
	spf = sieveForSmallestPrimeFactor()
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def si():
	return input()

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

def li():
	return list(map(int, input().split()))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = ii()
	a = list(si())
	b = list(si())
	ans = 0
	i = 0
	j = n - 1
	while i <= j:
		if i == j:
			if a[i] != b[i]:
				ans += 1
			break
		x = [a[i], a[j], b[i], b[j]]
		x = set(x)
		if len(x) == 1:
			i += 1
			j -= 1
			continue
		if len(x) == 2:
			if a[i] == a[j] and b[i] == b[j] or (a[i] == b[j] and a[j] == b[i]) or (a[i] == b[i] and a[j] == b[j]):
				i += 1
				j -= 1
				continue
			ans += 1
		elif len(x) == 3:
			if a[i] != a[j]:
				ans += 1
			else:
				ans += 2
		else:
			ans += 2
		i += 1
		j -= 1
	print(ans)
t = 1
for _ in range(t):
	solve()


from math import *
n = int(input())
a = input()
b = input()

def sr(i):
	if a[i] == a[n - i - 1]:
		if a[i] == b[n - i - 1] and a[i] == b[i]:
			return 0
		elif a[i] != b[n - i - 1] and a[i] == b[i] or (a[i] == b[n - i - 1] and a[i] != b[i]):
			return 1
		elif b[i] == b[n - i - 1]:
			return 0
		else:
			return 2
	elif a[n - i - 1] == b[n - i - 1] and a[i] == b[i] or (a[i] == b[n - i - 1] and a[n - i - 1] == b[i]):
		return 0
	elif a[n - i - 1] != b[n - i - 1] and a[i] != b[i] and (a[i] != b[n - i - 1]) and (a[n - i - 1] != b[i]) and (b[i] != b[n - i - 1]):
		return 2
	else:
		return 1
k = 0
for j in range(n // 2):
	k += sr(j)
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		k += 1
print(k)


from collections import *
n = int(input())
(a, b) = (input(), input())
c = 0
k = n // 2
for t in zip(a[:k], a[::-1], b, b[::-1]):
	d = Counter(t)
	l = len(d)
	if l == 2 and 1 in d.values():
		c += 1
	if l == 3:
		c += 1 + (t[0] == t[1])
	if l == 4:
		c += 2
print(c + (n % 2 and a[k] != b[k]))


def main():
	n = int(input())
	str1 = str(input())
	str2 = str(input())
	ans = 0
	for i in range(n // 2):
		if str1[i] == str2[i] and str1[n - 1 - i] == str2[n - i - 1] or (str1[i] == str2[n - 1 - i] and str1[n - 1 - i] == str2[i]) or (str1[i] == str1[n - 1 - i] and str2[i] == str2[n - 1 - i]):
			continue
		elif str1[i] != str2[i] and str1[i] != str2[n - 1 - i] and (str1[n - 1 - i] != str2[i]) and (str1[n - 1 - i] != str2[n - 1 - i]) and (str2[i] != str2[n - 1 - i]):
			ans += 2
		else:
			ans += 1
	if n % 2 != 0 and str1[n // 2] != str2[n // 2]:
		ans += 1
	print(ans)
	return
main()


n = int(input())
a = input()
b = input()
tos = []
for i in range(n):
	if i > n - i - 1:
		break
	if i == n - i - 1:
		tos.append([a[i], b[i], 'aa', 'aa'])
		break
	else:
		x = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
		tos.append(x)

def nos(x):
	a = x[:2]
	b = x[2:]
	a.sort()
	b.sort()
	a = ''.join(a)
	b = ''.join(b)
	if a == b:
		return 0
	if b[0] == b[1]:
		if a[0] == a[1]:
			return 0
		else:
			return 1
	if a[0] == b[0]:
		return 1
	if a[0] == b[1]:
		return 1
	if a[1] == b[0]:
		return 1
	if a[1] == b[1]:
		return 1
	return 2
if n == 1:
	if a == b:
		print(0)
	else:
		print(1)
else:
	changes = 0
	for i in tos:
		changes += nos(i)
	print(changes)


from collections import defaultdict
n = int(input())
a = input()
b = input()
ans = 0
for i in range(n // 2):
	mp = defaultdict(int)
	for c in (a[i], b[i], a[-i - 1], b[-i - 1]):
		mp[c] += 1
	if len(mp) == 1:
		pass
	elif len(mp) == 4:
		ans += 2
	elif len(mp) == 2:
		if mp[a[i]] != 2:
			ans += 1
	elif a[i] == a[-i - 1]:
		ans += 2
	else:
		ans += 1
if n % 2 == 1:
	ans += a[n // 2] != b[n // 2]
print(ans)


n = int(input())
a = input()
b = input()
p = 0
for i in range(n // 2):
	if a[i] != b[i] and a[i] != b[n - i - 1] and (a[i] != a[n - i - 1]):
		p += 1
		if b[i] != b[n - i - 1] and a[n - 1 - i] != b[i] and (a[n - 1 - i] != b[n - i - 1]) and (a[n - 1 - i] != a[i]):
			p += 1
	elif a[i] == b[i]:
		if a[n - i - 1] != b[n - i - 1]:
			p += 1
	elif a[i] == b[n - i - 1]:
		if a[n - i - 1] != b[i]:
			p += 1
	elif b[n - i - 1] != b[i]:
		p += 2
if a[n // 2] != b[n // 2] and n % 2 == 1:
	p += 1
print(p)


n = int(input())
(a, b) = (input(), input())
c = 0
k = n // 2
for (z, w, x, y) in zip(a[:k], a[::-1], b, b[::-1]):
	c += z != w if x == y else len({x, y} - {z, w})
print(c + (n % 2 and a[k] != b[k]))


def main():
	n = int(input())
	a = input()
	b = input()
	ret = n % 2 and a[n // 2] != b[n // 2]
	for i in range(n // 2):
		temp = set((a[i], a[n - 1 - i], b[i], b[n - 1 - i]))
		if len(temp) == 1:
			continue
		elif len(temp) == 2:
			ret += [a[i], a[n - 1 - i], b[i], b[n - 1 - i]].count(a[i]) != 2
		elif len(temp) == 3:
			ret += 1 + (a[i] == a[n - 1 - i])
		else:
			ret += 2
	print(ret + 0)
	return 0
main()


n = int(input())
a = input()
b = input()
c = 0
for i in range(n // 2):
	p = a[i]
	q = b[i]
	r = a[n - i - 1]
	s = b[n - i - 1]
	sl = len(set([p, q, r, s]))
	if sl == 3:
		if p == r:
			c += 2
		else:
			c += 1
	elif sl == 4:
		c += 2
	elif sl == 2:
		cp = 0
		for e in [p, q, r, s]:
			if e == p:
				cp += 1
		cq = 0
		for e in [p, q, r, s]:
			if e == q:
				cq += 1
		cr = 0
		for e in [p, q, r, s]:
			if e == r:
				cr += 1
		cs = 0
		for e in [p, q, r, s]:
			if e == s:
				cs += 1
		if cp == 3 or cq == 3 or cr == 3 or (cs == 3):
			c += 1
if n % 2:
	if a[n // 2] != b[n // 2]:
		c += 1
print(c)


n = int(input())
a = input()
b = input()
ans = 0
for i in range(len(a) // 2):
	ans += 2
	flag = False
	c = [a[i], b[i], a[n - i - 1], b[n - i - 1]]
	if c[0] == c[2] and c[1] != c[3] and (c[1] != c[0]) and (c[3] != c[0]):
		continue
	for j in range(3):
		for k in range(j + 1, 4):
			if c[j] == c[k]:
				ans -= 1
				c.pop(k)
				c.pop(j)
				flag = True
				break
		if flag:
			break
	if len(c) == 2 and c[0] == c[1]:
		ans -= 1
if len(a) % 2 == 1 and a[n // 2] != b[n // 2]:
	ans += 1
print(ans)


n = int(input())
a = input()
b = input()
m = 0

def swap(arr):
	val = arr[0]
	arr[0] = arr[1]
	arr[1] = val
aa = [0, 0]
bb = [0, 0]
for i in range(n // 2):
	aa[0] = a[i]
	aa[1] = a[-1 - i]
	bb[0] = b[i]
	bb[1] = b[-1 - i]
	if bb[0] == bb[1]:
		bb[0] = aa[0]
		aa[0] = bb[1]
	if bb[0] == aa[1]:
		swap(bb)
	if bb[1] == aa[0]:
		swap(bb)
	for j in range(2):
		if bb[j] != aa[j]:
			m += 1
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		m += 1
print(m)


n = int(input())
s = input()
s1 = input()
ans = 0
for i in range(n // 2):
	a = s[i]
	b = s[n - 1 - i]
	x = s1[i]
	y = s1[n - 1 - i]
	st = set()
	st1 = set()
	st2 = set()
	st.add(a)
	st.add(b)
	st1.add(x)
	st1.add(y)
	st2.add(a)
	st2.add(b)
	st2.add(x)
	st2.add(y)
	if len(st2) == 4:
		ans += 2
	elif len(st2) == 3:
		if len(st) == 1 and len(st1) == 2:
			ans += 2
		if len(st1) == 1 and len(st) == 2:
			ans += 1
		if len(st1) == 2 and len(st) == 2:
			ans += 1
	elif len(st2) == 2:
		if (len(st) == 2 or len(st1) == 2) and len(st) != len(st1):
			ans += 1
if n % 2 != 0:
	if s[n // 2] != s1[n // 2]:
		ans += 1
print(ans)


def call(a, b, c, d):
	if a == b and c == d or (a == c and b == d) or (a == d and b == c):
		return 0
	if c == d or b == c or b == d or (a == c) or (a == d):
		return 1
	return 2
n = int(input())
a = input()
b = input()
ans = 0
for i in range(n // 2):
	ans += call(a[i], a[n - i - 1], b[i], b[n - i - 1])
if n % 2 == 1:
	if a[n // 2] == b[n // 2]:
		pass
	else:
		ans += 1
print(ans)


n = int(input())
a = [i for i in input()]
b = [i for i in input()]
ans = 0
for i in range(n // 2):
	s_a = {a[i]}
	s_a |= {a[n - 1 - i]}
	s_b = {b[i]}
	s_b |= {b[n - 1 - i]}
	s_u = s_a | s_b
	cnt = len(s_u)
	if cnt == 2 and len(s_a) != len(s_b):
		ans += 1
	elif cnt == 3:
		if len(s_a) == 2:
			ans += 1
		elif len(s_b) == 2:
			ans += 2
		else:
			ans += 2
	elif cnt == 4:
		ans += 2
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		ans += 1
print(ans)


n = int(input())
a = input()
b = input()
ans = 0
if n % 2 != 0 and a[n // 2] != b[n // 2]:
	ans = 1
for i in range(n // 2):
	s = [a[i], b[i], a[n - i - 1], b[n - i - 1]]
	d = dict()
	for j in s:
		if d.get(j):
			d[j] += 1
		else:
			d[j] = 1
	if list(d.values()) != [2, 2] and list(d.values()) != [4]:
		if list(d.values()) == [1, 1, 1, 1]:
			ans += 2
			continue
		if a[i] == a[n - i - 1]:
			if list(d.values()) == [3, 1]:
				ans += 1
			else:
				ans += 2
			continue
		if b[i] == b[n - i - 1]:
			ans += 1
			continue
		ans += 1
print(ans)


from collections import Counter
n = int(input())
a = input()[:n]
b = input()[:n]
prelim = 0
for i in range(n // 2):
	c = Counter([a[i], a[n - 1 - i], b[i], b[n - 1 - i]])
	k = len(c)
	if k == 4:
		prelim += 2
	elif k == 3:
		prelim += 2 if a[i] == a[n - 1 - i] else 1
	elif k == 2:
		if 3 in list(c.values()):
			prelim += 1
if n % 2:
	if a[n // 2] != b[n // 2]:
		prelim += 1
print(prelim)


__author__ = 'liuzixiang'
from functools import reduce

def main():
	n = int(input())
	(a, b) = (input(), input())
	ans = 0
	for l in range((len(a) + 1) // 2):
		r = len(a) - l - 1
		if l == r:
			if a[l] != b[l]:
				ans += 1
			continue
		if a[l] == b[l]:
			if a[r] != b[r]:
				ans += 1
		elif a[l] == b[r]:
			if a[r] != b[l]:
				ans += 1
		elif a[r] == b[l]:
			if a[l] != b[r]:
				ans += 1
		elif a[r] == b[r]:
			if a[l] != b[l]:
				ans += 1
		elif a[l] == a[r]:
			if b[l] != b[r]:
				ans += 2
		elif b[l] == b[r]:
			ans += 1
		else:
			ans += 2
	print(ans)
main()


n = int(input())
A = list(str(input()))
B = list(str(input()))
from collections import Counter
ans = 0
if n % 2 == 0:
	for i in range(n // 2):
		L = [A[i], A[n - 1 - i], B[i], B[n - 1 - i]]
		C = Counter(L)
		V = list(C.values())
		V.sort()
		if V == [1, 1, 1, 1]:
			ans += 2
		elif V == [1, 1, 2]:
			if A[i] == A[n - 1 - i]:
				ans += 2
			else:
				ans += 1
		elif V == [1, 3]:
			ans += 1
		else:
			pass
else:
	for i in range(n // 2):
		L = [A[i], A[n - 1 - i], B[i], B[n - 1 - i]]
		C = Counter(L)
		V = list(C.values())
		V.sort()
		if V == [1, 1, 1, 1]:
			ans += 2
		elif V == [1, 1, 2]:
			if A[i] == A[n - 1 - i]:
				ans += 2
			else:
				ans += 1
		elif V == [1, 3]:
			ans += 1
		else:
			pass
	if A[n // 2] != B[n // 2]:
		ans += 1
print(ans)


from math import ceil
n = int(input())
word1 = input()
word2 = input()
combined = []
for i in range(ceil(n / 2)):
	if i > n / 2 - 1:
		combined.append([word1[i], word2[i]])
	else:
		combined.append([word1[i], word1[-i - 1], word2[i], word2[-i - 1]])
count = 0
for l in combined:
	s = set(l)
	if len(s) == 4:
		count += 2
	elif len(s) == 3:
		count += 1
		if l[0] == l[1]:
			count += 1
	elif len(s) == 2:
		counter = 0
		first_letter = l[0]
		for letter in l:
			if letter == first_letter:
				counter += 1
		if counter != 2:
			count += 1
print(count)


from collections import defaultdict
n = int(input())
a = input()
b = input()
count = 0
m = n // 2
p = (n - 1) // 2
if n % 2 == 1:
	if a[m] != b[m]:
		count += 1
for i in range(m + n % 2):
	d = defaultdict(int)
	d[a[m + i]] += 1
	d[a[p - i]] += 1
	d[b[m + i]] += 1
	d[b[p - i]] += 1
	if all([(i + 1) % 2 for i in list(d.values())]):
		continue
	if b[m + i] == b[p - i] or a[m + i] == b[m + i] or a[m + i] == b[p - i] or (a[p - i] == b[m + i]) or (a[p - i] == b[p - i]):
		count += 1
	else:
		count += 2
print(count)


t = 1
for test in range(t):
	n = int(input())
	a = input()
	b = input()
	count = 0
	for i in range(n // 2):
		arr = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
		tmp = len(set(arr))
		if tmp == 4:
			count += 2
		elif tmp == 1:
			continue
		elif tmp == 2:
			arr.sort()
			if arr[0] == arr[2] or arr[1] == arr[3]:
				count += 1
		elif a[i] == a[n - i - 1]:
			count += 2
		else:
			count += 1
	if n % 2 == 1 and a[n // 2] != b[n // 2]:
		count += 1
	print(count)


n = int(input())
string1 = input()
string2 = input()
attempts = 0
for i in range(n // 2):
	elements = [string1[i], string2[i], string1[-1 * (i + 1)], string2[-1 * (i + 1)]]
	counter = {}
	for j in elements:
		if j not in counter:
			counter[j] = 1
		else:
			counter[j] += 1
	if len(counter) == 1:
		pass
	if len(counter) == 2:
		if counter[list(counter.keys())[0]] == 2:
			pass
		else:
			attempts += 1
	if len(counter) == 3:
		if string1[i] == string1[-1 * (i + 1)]:
			attempts += 2
		else:
			attempts += 1
	if len(counter) == 4:
		attempts += 2
if n % 2 == 1:
	if string1[n // 2] != string2[n // 2]:
		attempts += 1
print(attempts)


N = int(input())
str1 = input()
str2 = input()
total = 0
for c in range(int(N / 2)):
	g = [str1[c], str1[-c - 1], str2[c], str2[-c - 1]]
	group = sorted(g)
	if group[0] == group[1] and group[2] == group[3]:
		pass
	elif group[0] != group[1] and group[1] != group[2] and (group[2] != group[3]) or (g[0] == g[1] and g[0] != g[2] and (g[0] != g[3])):
		total += 2
	else:
		total += 1
if N % 2 == 1:
	if str1[int(N / 2)] != str2[int(N / 2)]:
		total += 1
print(total)


n = int(input())
s = input()
w = input()
cnt = 0
for i in range(n // 2):
	l = [s[i], w[i], s[n - 1 - i], w[n - 1 - i]]
	ln = len(set(l))
	if s[i] != s[n - 1 - i] and w[i] == w[n - 1 - i]:
		cnt += 1
	elif ln == 2 or ln == 1:
		if int(bool(s[i] != w[n - 1 - i])) + int(bool(w[i] != s[n - 1 - i])) == 1:
			cnt += 1
	elif ln == 3:
		if s[i] == w[i] or s[n - 1 - i] == w[n - 1 - i] or s[i] == w[n - 1 - i] or (w[i] == s[n - 1 - i]):
			cnt += 1
		else:
			cnt += 2
	else:
		cnt += 2
if n % 2 and s[n // 2] != w[n // 2]:
	cnt += 1
print(cnt)


n = int(input())
a = [str(i) for i in input()]
b = [str(i) for i in input()]
ans = 0
for i in range(n // 2):
	if a[i] == b[i] and a[n - i - 1] == b[n - i - 1]:
		continue
	if a[i] == b[n - i - 1] and b[i] == a[n - i - 1]:
		continue
	if a[i] == a[n - i - 1] and b[i] == b[n - i - 1]:
		continue
	if a[i] == b[i] and a[n - i - 1] != b[n - i - 1]:
		ans += 1
		continue
	if a[i] != b[i] and a[n - i - 1] == b[n - i - 1]:
		ans += 1
		continue
	if a[i] == b[n - i - 1] and b[i] != a[n - i - 1]:
		ans += 1
		continue
	if b[i] == a[n - i - 1] and a[i] != b[n - i - 1]:
		ans += 1
		continue
	if b[i] == b[n - i - 1] and a[i] != a[n - i - 1]:
		ans += 1
		continue
	if a[i] == a[n - i - 1] and b[i] != b[n - i - 1]:
		ans += 2
		continue
	ans += 2
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		ans += 1
print(ans)


n = int(input())
a = input()
b = input()
o = 0
for i in range(n // 2):
	if b[i] == b[n - 1 - i]:
		o += int(a[i] != a[n - 1 - i])
	else:
		o += 2 - len(set([a[i], a[n - 1 - i]]) & set([b[i], b[n - 1 - i]]))
if n % 2:
	o += int(a[n // 2] != b[n // 2])
print(o)


import collections
n = int(input())
a = input()
b = input()
ans = 0
for i in range((n - 1) // 2 + 1):
	if n % 2 == 1 and i == (n - 1) // 2:
		if a[i] != b[i]:
			ans += 1
	else:
		cnt = collections.defaultdict(int)
		cnt[a[i]] += 1
		cnt[a[n - i - 1]] += 1
		cnt[b[i]] += 1
		cnt[b[n - i - 1]] += 1
		if len(cnt.keys()) == 1:
			ans += 0
		elif len(cnt.keys()) == 2:
			if max(cnt.values()) == 3:
				ans += 1
			else:
				ans += 0
		elif len(cnt.keys()) == 3:
			if a[i] == a[n - i - 1]:
				ans += 2
			else:
				ans += 1
		elif len(cnt.keys()) == 4:
			ans += 2
print(ans)


n = int(input())
a = str(input())
b = str(input())
res = 0
(l, r) = (0, n - 1)
while l < r:
	v = sorted([a[l], b[l], a[r], b[r]])
	sz = len(set(v))
	if sz == 2:
		if v[1] == v[2]:
			res += 1
	elif sz == 3:
		if a[l] in [b[l], b[r]]:
			res += 1
		elif a[r] in [b[l], b[r]]:
			res += 1
		elif b[l] == b[r]:
			res += 1
		else:
			res += 2
	elif sz == 4:
		res += 2
	l += 1
	r -= 1
if l == r and a[l] != b[l]:
	res += 1
print(res)


import math
from collections import defaultdict
from sys import stdin, stdout
input = stdin.readline

def main():
	n = int(input())
	s = input()
	t = input()
	res = 0
	for i in range(n // 2):
		d = defaultdict(int)
		for val in (s[i], s[n - i - 1], t[i], t[n - i - 1]):
			d[val] += 1
		x = sorted(d.values())
		if x == [1, 3]:
			res += 1
		elif x == [1, 1, 1, 1]:
			res += 2
		elif x == [1, 1, 2]:
			if s[i] == s[n - i - 1]:
				res += 2
			else:
				res += 1
	if n % 2 == 1 and s[n // 2] != t[n // 2]:
		res += 1
	print(res)
main()


n = int(input())
a = list(input())
b = list(input())
ans = 0
for i in range(n // 2):
	(a1, a2, b1, b2) = (a[i], a[-(i + 1)], b[i], b[-(i + 1)])
	l = len({a1, a2, b1, b2})
	if l == 1:
		continue
	elif l == 2:
		if a1 == a2 and b1 == b2 or (a1 == b1 and a2 == b2) or (a1 == b2 and a2 == b1):
			continue
		else:
			ans += 1
	elif l == 3:
		if a1 == a2:
			ans += 2
		else:
			ans += 1
	else:
		ans += 2
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	ans += 1
print(ans)


import collections
from functools import cmp_to_key
import math
import sys

def getIntList():
	return list(map(int, input().split()))
import bisect
try:
	import numpy
	dprint = print
	dprint('debug mode')
except ModuleNotFoundError:

	def dprint(*args, **kwargs):
		pass

def makePair(z):
	return [(z[i], z[i + 1]) for i in range(0, len(z), 2)]

def memo(func):
	cache = {}

	def wrap(*args):
		if args not in cache:
			cache[args] = func(*args)
		return cache[args]
	return wrap

@memo
def comb(n, k):
	if k == 0:
		return 1
	if n == k:
		return 1
	return comb(n - 1, k - 1) + comb(n - 1, k)
(N,) = getIntList()
s1 = input()
s2 = input()
t = N // 2
res = 0
for i in range(t):
	j = N - 1 - i
	z = [s1[i], s1[j], s2[i], s2[j]]
	z.sort()
	if z[0] == z[1] and z[2] == z[3]:
		continue
	if s2[i] == s2[j] or s1[i] == s2[i] or s1[i] == s2[j] or (s1[j] == s2[i]) or (s1[j] == s2[j]):
		res += 1
		continue
	res += 2
if N % 2 == 1:
	if s1[t] != s2[t]:
		res += 1
print(res)


n = int(input())
s = input()
t = input()
c = 0
for i in range(n // 2):
	M = [s[i], s[n - 1 - i]]
	M.sort()
	N = [t[i], t[n - 1 - i]]
	N.sort()
	if M[0] == N[0] and M[1] == N[1] or (M[0] == M[1] and N[0] == N[1]):
		c += 0
	elif M[0] == N[1] or M[1] == N[0] or N[0] == N[1] or (M[0] == N[0]) or (M[1] == N[1]):
		c += 1
	else:
		c += 2
if n % 2 == 1 and s[n // 2] != t[n // 2]:
	c += 1
print(c)


n = int(input())
l = input()
u = input()
ret = 0
for i in range(n // 2):
	temp = set((l[i], l[n - 1 - i], u[i], u[n - 1 - i]))
	if len(temp) == 1:
		continue
	elif len(temp) == 2:
		ret += [l[i], l[n - 1 - i], u[i], u[n - 1 - i]].count(l[i]) != 2
	elif len(temp) == 3:
		ret += 1 + (l[i] == l[n - 1 - i])
	else:
		ret += 2
if l[n // 2] != u[n // 2] and n % 2 == 1:
	ret += 1
print(ret)


length = int(input())
string1 = input()
string2 = input()
changes = 0
for i in range(length // 2):
	c1 = string1[i]
	c2 = string1[length - 1 - i]
	c3 = string2[i]
	c4 = string2[length - 1 - i]
	if c1 == c2 and c3 == c4:
		continue
	if c1 == c3 and c2 == c4:
		continue
	if c1 == c4 and c2 == c3:
		continue
	if c3 == c4:
		changes += 1
		continue
	if c1 == c3 or c2 == c4:
		changes += 1
		continue
	if c1 == c4 or c2 == c3:
		changes += 1
		continue
	changes += 2
if length % 2 == 1 and string1[length // 2] != string2[length // 2]:
	changes += 1
print(changes)


n = int(input())
a = input()
b = input()
c = int()
for i in range(n // 2):
	v = a[i]
	u = a[n - i - 1]
	x = b[i]
	y = b[n - i - 1]
	if v == x:
		if u != y:
			c += 1
	elif v == y:
		if u != x:
			c += 1
	elif x == y:
		if u != v:
			c += 1
	elif u != x and u != y:
		c += 2
	else:
		c += 1
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		c += 1
print(c)


def solve(a, b, n):
	assert len(a) == len(b)
	assert len(a) == n
	cost = 0
	for i in range(0, n // 2):
		j = n - i - 1
		if a[i] == b[i] and a[j] == b[j]:
			continue
		beg = set([a[i], b[i]])
		end = set([a[j], b[j]])
		if beg == end:
			continue
		if a[i] == b[i] or a[j] == b[j]:
			cost += 1
		elif b[i] == b[j]:
			cost += 1
		elif a[i] == b[j] or a[j] == b[i]:
			cost += 1
		else:
			cost += 2
	if n % 2 == 1:
		if a[n // 2] != b[n // 2]:
			cost += 1
	return cost
assert solve('abc', 'abc', 3) == 0
assert solve('abcd', 'abcd', 4) == 0
assert solve('dbca', 'abcd', 4) == 0
assert solve('abca', 'dbcd', 4) == 0
assert solve('aecdef', 'abcdbf', 6) == 0
assert solve('aecdez', 'abcdbf', 6) == 1
assert solve('abacaba', 'bacabaa', 7) == 4
assert solve('zcabd', 'dbacz', 5) == 0
n = int(input())
a = input()
b = input()
cost = solve(a, b, n)
print(cost)


from collections import *
import os, sys
from io import BytesIO, IOBase

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
r = lambda dtype: dtype(input().strip())
rd = lambda dtype: [dtype(x) for x in input().split()]
r2d = lambda dtype, n: [r(dtype) for _ in range(n)]
rs2d = lambda dtype, n: [rd(dtype) for _ in range(n)]
r_enu = lambda dtype: [(i, x) for (i, x) in enumerate(rd(dtype))]
rs_enu = lambda dtype, n: [[i, rd(dtype)] for i in range(n)]
ceil1 = lambda a, b: (a + b - 1) // b
(n, a, b, ans) = (r(int), r(str), r(str), 0)
for i in range(ceil1(n, 2)):
	dis = {a[i], b[i], a[n - i - 1], b[n - i - 1]}
	if len(dis) == 4:
		ans += 2
	elif len(dis) == 3:
		if a[i] == a[n - i - 1]:
			ans += 1
		ans += 1
	elif len(dis) == 2:
		if i == n >> 1 or (a[i] == b[i] and a[n - i - 1] != b[n - i - 1]) or (a[i] != b[i] and a[n - i - 1] == b[n - i - 1]):
			ans += 1
print(ans)


def path(x1, y1, x2, y2):
	(plus1, plus2) = (0, 0)
	if x1 != y1:
		plus1 = 1
	if x2 != y2:
		plus1 += 1
	(y1, y2) = (y2, y1)
	if x1 != y1:
		plus2 = 1
	if x2 != y2:
		plus2 += 1
	return min(plus1, plus2)
n = int(input())
a = input()
b = input()
res = 0
for i in range(n // 2):
	(x1, x2) = (a[i], a[n - i - 1])
	(y1, y2) = (b[i], b[n - i - 1])
	if y1 == y2:
		if x1 != x2:
			res += 1
	else:
		res += path(x1, y1, x2, y2)
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		res += 1
print(res)


from collections import Counter
n = int(input())
a = input()
b = input()
pre = 0
for i in range(n // 2):
	a1 = [a[i], a[n - i - 1]]
	b1 = [b[i], b[n - i - 1]]
	tot = len(Counter(a1 + b1))
	if tot == 1:
		pre += 0
	if tot == 2:
		pre += abs(len(Counter(a1)) - len(Counter(b1)))
	if tot == 3:
		if len(Counter(a1)) == 1:
			pre += 2
		else:
			pre += 1
	if tot == 4:
		pre += 2
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		pre += 1
print(pre)


n = int(input())
a = input()
b = input()
i = n // 2
if n % 2 == 0:
	i -= 1
cnt = 0
while i > -1:
	set_a = {a[i], a[-i - 1]}
	set_b = {b[i], b[-i - 1]}
	if len(set_a) == 1:
		if len(set_b) != 1:
			if a[i] == b[i] or a[i] == b[-i - 1]:
				cnt += 1
			else:
				cnt += 2
		if len(set_b) == 1 and n % 2 == 1 and (n // 2 == i) and (set_a != set_b):
			cnt += 1
	if len(set_a) == 2:
		if len(set_b) == 1:
			cnt += 1
		if len(set_b) == 2:
			common = set_a.intersection(set_b)
			if len(common) == 0:
				cnt += 2
			if len(common) == 1:
				cnt += 1
	i -= 1
print(cnt)


from math import ceil, sqrt, log, gcd

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

def si():
	return input()

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

def li():
	return list(mi())
n = ii()
s1 = si()
s2 = si()
ans = 0
for i in range(n // 2):
	m = {}
	b = [s1[i], s1[n - i - 1], s2[i], s2[n - i - 1]]
	for j in b:
		if j not in m:
			m[j] = 1
		else:
			m[j] += 1
	if len(m) == 4:
		ans += 2
	if len(m) == 3:
		if s1[i] == s1[n - i - 1]:
			ans += 2
		else:
			ans += 1
	if len(m) == 2:
		b = []
		for k in m.keys():
			b.append(m[k])
		if b[0] != b[1]:
			ans += 1
if n & 1:
	if s1[n // 2] != s2[n // 2]:
		ans += 1
print(ans)


i = int(input())
a = input()
b = input()
add = 0
if i % 2 != 0:
	g = len(set(a[i // 2] + b[i // 2]))
	if g == 2:
		add += 1
	else:
		add += 0
for i in range(i // 2):
	c = len(set(a[len(a) - 1 - i] + b[len(a) - 1 - i])) + len(set(a[i] + b[i]))
	if c == 2:
		add += 0
	elif c == 3:
		add += 1
	elif c == 4:
		d = len(set(a[i] + a[len(a) - 1 - i]))
		if d == 1:
			s = len(set(a[len(a) - 1 - i] + b[len(a) - 1 - i] + a[i] + b[i]))
			if s == 3:
				add += 2
			elif s == 2:
				add += 0
		elif d == 2:
			w = len(set(a[len(a) - 1 - i] + b[len(a) - 1 - i] + a[i] + b[i]))
			if w == 3:
				add += 1
			elif w == 4:
				add += 2
			elif w == 2:
				add += 0
print(add)


n = int(input())
a = list(input())
b = list(input())
(x, y) = ([0] * n, [0] * n)
ans = 0
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	ans += 1
for i in range(n // 2):
	t = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
	tmp = 0
	tmp1 = 0
	tmp2 = 0
	tmp3 = 0
	xx = 0
	if t[0] != t[2]:
		tmp1 += 1
	if t[1] != t[3]:
		tmp1 += 1
	(t[0], t[1]) = (t[1], t[0])
	if t[0] != t[2]:
		tmp2 += 1
	if t[1] != t[3]:
		tmp2 += 1
	if t[0] != t[1]:
		t[0] = t[1]
		xx = 1
	if t[0] != t[2]:
		tmp3 += 1
	if t[1] != t[3]:
		tmp3 += 1
	if t[0] == t[1] and t[2] == t[3]:
		ans += xx
	else:
		ans += min(tmp1, tmp2, tmp3)
print(ans)


n = int(input())
str1 = input()
str2 = input()
ans = 0
count = {}
for i in range(n // 2):
	try:
		count[str1[i]] += 1
	except KeyError:
		count[str1[i]] = 1
	try:
		count[str2[i]] += 1
	except KeyError:
		count[str2[i]] = 1
	try:
		count[str1[n - i - 1]] += 1
	except KeyError:
		count[str1[n - i - 1]] = 1
	try:
		count[str2[n - i - 1]] += 1
	except KeyError:
		count[str2[n - i - 1]] = 1
	if len(count) == 3:
		ans += 1
		if str1[i] == str1[n - i - 1]:
			ans += 1
	if len(count) == 4:
		ans += 2
	if len(count) == 2:
		if count[str1[i]] != 2:
			ans += 1
	count.clear()
if n % 2 == 1 and str1[n // 2] != str2[n // 2]:
	ans += 1
print(ans)


n = int(input())
a = input()
b = input()
l = 0
r = n - 1
ans = 0
while l < r:
	x1 = a[l]
	x2 = a[r]
	y1 = b[l]
	y2 = b[r]
	if x1 == y1 and x2 == y2 or (x1 == y2 and x2 == y1) or (x1 == x2 and y1 == y2):
		ans += 0
	elif (x1 == y1 or x2 == y2) or (x1 == y2 or x2 == y1) or y1 == y2:
		ans += 1
	else:
		ans += 2
	l += 1
	r -= 1
if l == r:
	ans += 1 if a[l] != b[l] else 0
print(ans)


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = input()
b = input()
c = 0
for i in range(0, n // 2):
	s = Counter([a[i], b[i], a[n - i - 1], b[n - i - 1]])
	if len(s.keys()) == 2:
		if 1 in s.values():
			c = c + 1
	elif len(s.keys()) == 3:
		if a[i] == a[n - i - 1]:
			c = c + 2
		else:
			c = c + 1
	elif len(s.keys()) == 4:
		c = c + 2
if n % 2 != 0:
	if a[n // 2] != b[n // 2]:
		c = c + 1
print(c)


n = int(input())
a = input()
b = input()
c = 0
for i in range(n // 2):
	e = sorted([a[i], b[i], a[-i - 1], b[-i - 1]])
	if not (e[0] == e[1] and e[2] == e[3]):
		if e[0] == e[1] == e[2] or e[1] == e[2] == e[3]:
			c += 1
		elif len(set(e)) == 4:
			c += 2
		elif a[i] == a[-i - 1]:
			c += 2
		else:
			c += 1
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	c += 1
print(c)


n = int(input())
(a, b) = (input(), input())
k = n // 2
c = a[k] != b[k] and n % 2
for (u, v, x, y) in zip(a[:k], a[::-1], b, b[::-1]):
	c += (len({x, y} - {u, v}), u != v)[x == y]
print(c)


import atexit, io, sys, collections, math, heapq, fractions, copy, os, functools
import sys
import random
import collections
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = input()
b = input()
ans = 0
for i in range(n // 2):
	r = [a[i], a[-i - 1], b[i], b[-i - 1]]
	cc = collections.Counter()
	for e in r:
		cc[e] += 1
	if len(cc) == 4:
		ans += 2
	elif len(cc) == 3:
		ans += 1
		if r[0] == r[1]:
			ans += 1
	elif len(cc) == 2:
		for e in cc:
			if cc[e] == 1:
				ans += 1
				break
if n % 2 and a[n // 2] != b[n // 2]:
	ans += 1
print(ans)


n = int(input())
a = input()
cnt = 0
b = input()
if True:
	if n % 2 == 0:
		maxx = n // 2
	else:
		maxx = n // 2 + 1
	for i in range(maxx):
		if i == n - i - 1:
			if a[i] != b[i]:
				cnt += 1
			continue
		p1 = a[i]
		p2 = a[n - i - 1]
		q1 = b[i]
		q2 = b[n - i - 1]
		if p1 == p2:
			if q1 == q2:
				pass
			elif p1 == q1 or p1 == q2:
				cnt += 1
			else:
				cnt += 2
		elif q1 == q2:
			cnt += 1
		elif p1 == q1 and p2 == q2 or (p1 == q2 and p2 == q1):
			cnt += 0
		elif (p1 == q1 or p2 == q2) or (p1 == q2 or p2 == q1):
			cnt += 1
		else:
			cnt += 2
	print(cnt)


import sys
sys.setrecursionlimit(10 ** 9)
from collections import defaultdict
n = int(input())
s1 = list(input())
s2 = list(input())
seti = set()
ans = 0
i = 0
while i < n // 2:
	(z1, z2) = (s1[i], s2[i])
	(z3, z4) = (s1[n - i - 1], s2[n - i - 1])
	if z3 == z4:
		if z1 == z2:
			pass
		else:
			ans += 1
		i += 1
	elif z1 == z2:
		if z3 == z4:
			pass
		else:
			ans += 1
		i += 1
	elif z1 == z4:
		if z3 == z4:
			ans += 1
		elif z2 == z3:
			pass
		else:
			ans += 1
		i += 1
	elif z2 == z3:
		if z3 == z4:
			ans += 1
		elif z1 == z4:
			pass
		else:
			ans += 1
		i += 1
	elif z1 == z3 and z2 == z4:
		i += 1
	elif z2 == z4:
		ans += 1
		i += 1
	else:
		ans += 2
		i += 1
if n % 2 != 0:
	if s1[n // 2] != s2[n // 2]:
		ans += 1
print(ans)


from sys import stdin, stdout
from collections import defaultdict

def p(s):
	stdout.write(str(s) + '\n')

def ps(s):
	stdout.write(s + '\n')

def r():
	return stdin.readline()

def swap1(s, i, j):
	lst = list(s)
	(lst[i], lst[j]) = (lst[j], lst[i])
	return ''.join(lst)

def swap2(s, i, j):
	return ''.join((s[:i], s[j], s[i + 1:j], s[i], s[j + 1:]))

def swap3(s1, s2, i):
	lst1 = list(s1)
	lst2 = list(s2)
	(lst1[i], lst2[i]) = (lst2[i], lst1[i])
	return (''.join(lst1), ''.join(lst2))

def main():
	n = int(r())
	s1 = r()
	s2 = r()
	cnt = 0
	k = int(n / 2) + 1 if n % 2 == 1 else int(n / 2)
	for i in range(k):
		if i == n - i - 1:
			if s1[i] != s2[i]:
				cnt += 1
				break
		d = defaultdict(lambda : 0)
		d[s1[i]] += 1
		d[s2[i]] += 1
		d[s1[n - i - 1]] += 1
		d[s2[n - i - 1]] += 1
		if len(d) == 4:
			cnt += 2
		elif len(d) == 3:
			cnt += 1 + (s1[i] == s1[n - i - 1])
		elif len(d) == 2:
			cnt += d[s1[i]] != 2
	p(cnt)
main()


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = input()
b = input()
count = 0
for i in range(n // 2):
	s = set()
	s.add(a[i])
	s.add(b[i])
	s.add(a[n - 1 - i])
	s.add(b[n - 1 - i])
	d = dict()
	if a[i] in d:
		d[a[i]] += 1
	else:
		d[a[i]] = 1
	if b[i] in d:
		d[b[i]] += 1
	else:
		d[b[i]] = 1
	if a[n - 1 - i] in d:
		d[a[n - 1 - i]] += 1
	else:
		d[a[n - 1 - i]] = 1
	if b[n - 1 - i] in d:
		d[b[n - 1 - i]] += 1
	else:
		d[b[n - 1 - i]] = 1
	if len(s) == 1:
		continue
	elif len(s) == 4:
		count += 2
	elif len(s) == 3:
		if a[i] == a[n - 1 - i]:
			count += 2
		else:
			count += 1
	else:
		p = list(s)
		if d[p[0]] != d[p[1]]:
			count += 1
if n % 2 == 1:
	i = n // 2
	if a[i] != b[i]:
		count += 1
print(count)


n = int(input())
s1 = input()
s2 = input()
(low, high) = (0, n - 1)
gcount = 0
while high >= low:
	d = {}
	lst = []
	if high > low:
		lst.append(s1[low])
		lst.append(s1[high])
		lst.append(s2[low])
		lst.append(s2[high])
	elif high == low:
		lst.append(s1[low])
		lst.append(s2[low])
	for c in lst:
		if d.get(c) == None:
			d[c] = 1
		else:
			d[c] += 1
	if len(lst) == 2 and 1 in d.values():
		gcount += 1
	elif len(lst) == 4 and 3 in d.values():
		gcount += 1
	elif len(lst) == 4 and len(d) == 3 and (s1[low] == s1[high]):
		gcount += 2
	elif len(lst) == 4 and len(d) == 3:
		gcount += 1
	elif len(lst) == 4 and len(d) == 4:
		gcount += 2
	high -= 1
	low += 1
print(gcount)


aux = [0 for _ in range(300)]
n = int(input().strip())
a = list(input().strip())
b = list(input().strip())
ans = 0
for i in range(n // 2):
	letters = set()
	letters.add(a[i])
	letters.add(b[i])
	letters.add(a[n - i - 1])
	letters.add(b[n - i - 1])
	if len(letters) == 4:
		ans += 2
	elif len(letters) == 3:
		if a[i] == a[n - i - 1]:
			ans += 2
		else:
			ans += 1
	elif len(letters) == 2:
		aux[ord(a[i])] = 0
		aux[ord(a[n - i - 1])] = 0
		aux[ord(b[i])] = 0
		aux[ord(b[n - i - 1])] = 0
		aux[ord(a[i])] += 1
		aux[ord(a[n - i - 1])] += 1
		aux[ord(b[i])] += 1
		aux[ord(b[n - i - 1])] += 1
		if aux[ord(a[i])] & 1 or aux[ord(a[n - i - 1])] & 1 or aux[ord(b[i])] & 1 or aux[ord(b[n - i - 1])] & 1:
			ans += 1
if n & 1:
	ans += a[n // 2] != b[n // 2]
print(ans)


n = int(input())
(a, b) = (input(), input())
res = 0
if n % 2 != 0 and a[n // 2] != b[n // 2]:
	res += 1
for i in range(0, n // 2):
	a2 = (a[i], a[n - 1 - i])
	b2 = (b[i], b[n - 1 - i])
	if b2[0] == b2[1]:
		res += 0 if a2[0] == a2[1] else 1
	else:
		if a2[0] == a2[1] and a2[0] in b2:
			res += 1
		if a2[0] in b2 and a2[1] in b2:
			pass
		elif a2[0] in b2 or a2[1] in b2:
			res += 1
		else:
			res += 2
print(res)


from collections import defaultdict, Counter, deque
read = lambda : list(map(int, input().split()))
getinfo = lambda grid: print(list(map(print, grid)))
p = lambda x: print(x, end=' ')
inf = float('inf')
mod = 10 ** 9 + 7
n = int(input())
A = input()
B = input()
res = 0
for i in range(n // 2):
	j = n - i - 1
	if Counter([A[i], B[i]]) == Counter([A[j], B[j]]) or Counter([A[i], A[j]]) == Counter([B[i], B[j]]):
		continue
	elif B[i] in A[j] + B[j] or B[j] in A[i] + B[i] or A[i] == B[i] or (A[j] == B[j]):
		res += 1
	else:
		res += 2
if n % 2 == 1:
	index = n // 2
	res += A[index] != B[index]
print(res)


count_symbols = int(input())
(strA, strB) = (input(), input())
steps_count = 0
symbol_repeat = dict()
for index in range(count_symbols // 2):
	indLeft = index
	indRight = count_symbols - index - 1
	symbols = [strA[indLeft], strA[indRight], strB[indLeft], strB[indRight]]
	for symbol in symbols:
		if symbol in symbol_repeat:
			symbol_repeat[symbol] += 1
		else:
			symbol_repeat[symbol] = 1
	if len(symbol_repeat) == 4:
		steps_count += 2
	elif len(symbol_repeat) == 3:
		steps_count += 1 + int(strA[indLeft] == strA[indRight])
	elif len(symbol_repeat) == 2:
		steps_count += symbol_repeat[strA[indLeft]] != 2
	symbol_repeat.clear()
steps_count += int(count_symbols % 2 != 0 and strA[count_symbols // 2] != strB[count_symbols // 2])
print(steps_count)


def f(a, b, c, d):
	if a == c:
		if b == d:
			return 0
	if a == b:
		if c == d:
			return 0
	if a == d:
		if c == b:
			return 0
	if a == b or a == d or c == d or (c == b) or (b == d):
		return 1
	return 2
n = int(input())
a = input()
b = input()
if n % 2:
	if a[n // 2] == b[n // 2]:
		ans = 0
	else:
		ans = 1
else:
	ans = 0
for i in range(n // 2):
	ans += f(a[i], b[i], a[n - i - 1], b[n - i - 1])
print(ans)


n = int(input())
a = input()
b = input()
result = 0
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	result = 1
for i in range(n // 2):
	s = a[i] + a[n - i - 1] + b[i] + b[n - i - 1]
	diff = 0
	for j in set(s):
		count = s.count(j)
		if count == 4:
			diff = 0
			break
		elif count == 3:
			diff = 1
			break
		elif count == 2:
			if len(set(s)) == 2:
				diff = 0
				break
			elif s[0] == s[1]:
				diff = 2
			else:
				diff = 1
		elif len(set(s)) == 4:
			diff = 2
			break
	result += diff
print(result)


from collections import defaultdict
n = int(input())
(s1, s2) = (input(), input())
ans = 0
if n & 1:
	if s1[n // 2] != s2[n // 2]:
		ans += 1
for i in range(n // 2):
	(l, r) = (i, n - 1 - i)
	st = set()
	st.add(s2[l])
	st.add(s2[r])
	if len(st) == 1:
		if s1[l] != s1[r]:
			ans += 1
	else:
		f = 0
		if s1[l] in st:
			f += 1
		if s1[r] in st:
			f += 1
		if f == 2 and s1[l] == s1[r] or f == 1:
			ans += 1
		elif f == 0:
			ans += 2
print(ans)


import os
import sys
from math import *
from collections import *
from heapq import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcde'
M = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

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

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for i in range(1):
	n = Int()
	a = input()
	b = input()
	ans = 0
	for i in range(n // 2):
		upper = (a[i], a[n - i - 1])
		lower = (b[i], b[n - i - 1])
		if lower[0] == lower[1]:
			ans += len(set(upper)) - 1
		else:
			ans += (lower[0] not in upper) + (lower[1] not in upper)
	if n % 2:
		ans += a[n // 2] != b[n // 2]
	print(ans)


def f(a, b, c, d):
	if a == b and c == d or (a == c and b == d) or (a == d and b == c):
		return 0
	if c == d or b == c or b == d or (a == c) or (a == d):
		return 1
	return 2
n = int(input())
(a, b, s) = (input(), input(), 0)
for i in range(n // 2):
	s += f(a[i], a[n - 1 - i], b[i], b[n - 1 - i])
if n & 1 and a[n // 2] != b[n // 2]:
	s += 1
print(s)


from collections import Counter
R = lambda : map(int, input().split())
n = int(input())
s1 = input()
s2 = input()
ans = 0
for i in range(n // 2):
	t = [s1[i], s1[n - i - 1], s2[i], s2[n - i - 1]]
	c = sorted(list(Counter(t).values()))
	m = len(c)
	if m == 4:
		ans += 2
	elif m == 3:
		ans += 1
		if s1[i] == s1[n - i - 1]:
			ans += 1
	elif m == 2 and c[-1] == 3:
		ans += 1
if n % 2:
	p = (n - 1) // 2
	if s1[p] != s2[p]:
		ans += 1
print(ans)


import sys
n = int(input())
a = input()
b = input()
to = 0
for i in range(int((n + 1) / 2)):
	c = n - i - 1
	if i == c:
		if a[i] != b[i]:
			to += 1
	else:
		m = {}
		m[a[i]] = 1
		try:
			m[b[i]] += 1
		except KeyError:
			m[b[i]] = 1
		try:
			m[b[c]] += 1
		except KeyError:
			m[b[c]] = 1
		try:
			m[a[c]] += 1
		except KeyError:
			m[a[c]] = 1
		if len(m) == 4:
			to += 2
		elif len(m) == 3:
			to += 1
			if b[i] != b[c] and a[i] == a[c]:
				to += 1
		elif len(m) == 2:
			for kk in m:
				if m[kk] == 1:
					to += 1
print(to)


def main():
	n = int(input())
	a = input()
	b = input()
	res = 0
	for i in range(n // 2):
		j = n - i - 1
		if b[i] == b[j]:
			if a[i] != a[j]:
				res += 1
		else:
			bs = [b[i], b[j]]
			if a[i] in bs:
				bs.remove(a[i])
			else:
				res += 1
			if a[j] not in bs:
				res += 1
	if n % 2 == 1 and a[n // 2] != b[n // 2]:
		res += 1
	print(res)
main()


from sys import stdin, stdout
from collections import defaultdict
import math
import copy
N = int(input())
s1 = input()
s2 = input()
left = 0
right = N - 1
res = 0
while left <= right:
	four = []
	four.append(s1[left])
	if left != right:
		four.append(s1[right])
	four.append(s2[left])
	if left != right:
		four.append(s2[right])
	f = {}
	if len(four) == 2 and four[0] != four[1]:
		res += 1
	elif len(four) == 4:
		for i in range(4):
			f[four[i]] = 0
		for i in range(4):
			f[four[i]] += 1
		freq = []
		for c in f:
			freq.append(f[c])
		if 4 in freq:
			res += 0
		elif 3 in freq:
			res += 1
		elif freq == [2, 2]:
			res += 0
		elif freq == [2, 1, 1] or freq == [1, 2, 1] or freq == [1, 1, 2]:
			if s1[left] == s1[right]:
				res += 2
			else:
				res += 1
		elif freq == [1, 1, 1, 1]:
			res += 2
	left += 1
	right -= 1
print(res)


n = int(input())
(a, b) = (input(), input())
r = 0
for i in range(n // 2):
	(x, y, z, w) = (b[i], b[-1 - i], a[i], a[-1 - i])
	if x == y:
		r += z != w
	else:
		r += len({x, y} - {z, w})
r += n % 2 and a[n // 2] != b[n // 2]
print(r)


from collections import Counter
n = int(input())
a = input()
b = input()
ans = 0
cursor = 1
temp = 0
cursor = 0
while cursor < n // 2:
	sa = [a[cursor], a[-1 - cursor]]
	sb = [b[cursor], b[-1 - cursor]]
	if len(set(sb)) == 2:
		ans += 2 - len(set(sa) & set(sb))
	else:
		ans += len(set(sa)) - 1
	cursor += 1
if n % 2:
	ans += a[n // 2] != b[n // 2]
print(ans)


from collections import defaultdict
n = int(input())
a = input()
b = input()
ans = 0
for i in range(n // 2):
	tmpdict = defaultdict(int)
	tmplist = [a[i], b[i], a[n - 1 - i], b[n - 1 - i]]
	for x in tmplist:
		tmpdict[x] += 1
	if len(tmpdict) == 4:
		ans += 2
	elif len(tmpdict) == 3:
		ans += 1 + (a[i] == a[n - i - 1])
	elif len(tmpdict) == 2:
		ans += tmpdict[a[i]] != 2
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	ans += 1
print(ans)


from sys import stdin
from math import *
line = stdin.readline().rstrip().split()
n = int(line[0])
numbers = stdin.readline().rstrip().split()[0]
numbers2 = stdin.readline().rstrip().split()[0]
moves = 0
for i in range(int(ceil(len(numbers) / 2))):
	if i == int(ceil(len(numbers) / 2)) - 1 and len(numbers) % 2 == 1:
		if numbers[i] != numbers2[i]:
			moves += 1
		break
	elif numbers2[i] == numbers2[n - (i + 1)]:
		if numbers[i] != numbers[n - (i + 1)]:
			moves += 1
	elif numbers[i] == numbers2[i] and numbers[n - (i + 1)] == numbers2[n - (i + 1)]:
		moves += 0
	elif numbers[i] == numbers2[n - (i + 1)] and numbers[n - (i + 1)] == numbers2[i]:
		moves += 0
	elif numbers[i] == numbers2[i] or numbers[i] == numbers2[n - (i + 1)] or numbers[n - (i + 1)] == numbers2[i] or (numbers[n - (i + 1)] == numbers2[n - (i + 1)]):
		moves += 1
	else:
		moves += 2
print(moves)


n = int(input())
a = list(input())
b = list(input())
i1 = 0
i2 = n - 1
s = 0

def fun(t1, t2):
	t1.sort()
	t2.sort()
	if t1 == t2:
		return True
	elif t1[0] == t1[1] and t2[0] == t2[1]:
		return True
	return False
from collections import Counter
while i1 < i2:
	cnt = Counter([a[i1], a[i2], b[i1], b[i2]])
	if len(cnt) == 4:
		s += 2
	elif len(cnt) == 3:
		if a[i1] == a[i2]:
			s += 2
		else:
			s += 1
	elif len(cnt) == 2:
		if cnt[a[i1]] != 2:
			s += 1
	i1 += 1
	i2 -= 1
if n % 2:
	if a[n // 2] != b[n // 2]:
		s += 1
print(s)


n = int(input())
a = input()
b = input()
moves = 0
for i in range(n // 2):
	cond1 = a[i] == a[n - i - 1] and b[i] == b[n - i - 1]
	cond2 = a[i] == b[i] and a[n - i - 1] == b[n - i - 1]
	cond3 = a[i] == b[n - i - 1] and a[n - i - 1] == b[i]
	if cond1 or cond2 or cond3:
		continue
	else:
		s = set()
		s.add(a[i])
		s.add(a[n - i - 1])
		s.add(b[i])
		s.add(b[n - i - 1])
		if len(s) == 4 or (len(s) == 3 and a[i] == a[n - i - 1]):
			moves += 2
		else:
			moves += 1
if n % 2 != 0 and a[n // 2] != b[n // 2]:
	moves += 1
print(moves)


n = int(input())
st1 = list(input())
st2 = list(input())
ans = 0
for i in range(n // 2 + n % 2):
	if i == n - i - 1:
		if st1[i] != st2[i]:
			ans += 1
		break
	if st2[i] == st2[n - i - 1]:
		if st1[i] != st1[n - i - 1]:
			ans += 1
	else:
		if st1[i] != st2[i] and st1[n - i - 1] != st2[i]:
			ans += 1
		if st1[i] != st2[n - i - 1] and st1[n - i - 1] != st2[n - i - 1]:
			ans += 1
print(ans)


n = int(input())
a = input()
b = input()
L = []
for i in range(n // 2):
	L.append([a[i], a[n - 1 - i], b[i], b[n - 1 - i]])
s = 0
for i in L:
	D = {}
	for j in i:
		if j in D:
			D[j] += 1
		else:
			D[j] = 1
	if len(D) == 2:
		if 1 in D.values():
			s += 1
	if len(D) == 3:
		if i[0] == i[1]:
			s += 2
		else:
			s += 1
	if len(D) == 4:
		s += 2
if n % 2 == 1:
	s += 1 - (a[(n - 1) // 2] == b[(n - 1) // 2])
print(s)


import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(ord, readline().strip()))
B = list(map(ord, readline().strip()))
ans = 0
for i in range(N // 2):
	(a, b, c, d) = (A[i], B[i], A[N - 1 - i], B[N - 1 - i])
	if a == c and b == d:
		continue
	if a == b and c == d:
		continue
	if a == d and b == c:
		continue
	if b == d or a == d or b == c or (c == d) or (a == b):
		ans += 1
		continue
	ans += 2
if N & 1:
	if A[N // 2] != B[N // 2]:
		ans += 1
print(ans)


n = int(input())
a = input()
b = input()
c = 0
for i in range(n // 2):
	m = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
	d = dict()
	for let in m:
		if d.get(let, False):
			d[let] += 1
		else:
			d[let] = 1
	if len(set(m)) == 1:
		continue
	elif len(set(m)) == 2:
		num = sorted([d[let] for let in m])
		if num[0] == 1:
			c += 1
	elif len(set(m)) == 3:
		if a[i] == a[n - i - 1]:
			c += 2
		else:
			c += 1
	elif len(set(m)) == 4:
		c += 2
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	c += 1
print(c)


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
S = input()
T = input()
A = [Counter() for i in range(N // 2)]
B = [Counter() for i in range(N // 2)]
for i in range(N // 2):
	A[i][S[i]] += 1
	A[i][S[N - i - 1]] += 1
	B[i][T[i]] += 1
	B[i][T[N - i - 1]] += 1

def check(C):
	if len(C) == 1:
		return True
	if len(C) > 2:
		return False
	for v in C.values():
		if v != 2:
			return False
	return True
cnt = 0
for i in range(N // 2):
	(C1, C2) = (A[i], B[i])
	C = C1 + C2
	if check(C):
		continue
	if len(C2) == 1:
		cnt += 1
		continue
	for (k, v) in C2.items():
		for _ in range(v):
			if C1[k] > 0:
				C1[k] -= 1
			else:
				cnt += 1
if N % 2 == 1 and S[N // 2] != T[N // 2]:
	cnt += 1
print(cnt)


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
from bisect import bisect, bisect_left
from itertools import permutations as per
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
nCr = lambda x, y: f[x] * inv(f[y] * f[x - y] % N) % N
n = I()
x = S()
y = S()
ans = 0
for i in range(n // 2):
	a = x[i]
	b = x[-i - 1]
	c = y[i]
	d = y[-i - 1]
	if a == b == c == d or a == b != c == d or a == c != b == d or (a == d != c == b):
		continue
	elif c != a == b != d != c or len(set([a, b, c, d])) == 4:
		ans += 2
	else:
		ans += 1
print(ans + (1 if n % 2 and x[n // 2] != y[n // 2] else 0))


for _ in range(1):
	n = int(input())
	st = input()
	rt = input()
	i = 0
	j = n - 1
	count = 0
	while i <= j:
		if i == j:
			count = count + 0 if st[i] == rt[j] else count + 1
		elif st[i] == rt[i] and st[j] == rt[j]:
			count += 0
		elif st[i] == rt[j] and rt[i] == st[j]:
			count += 0
		elif st[i] == st[j] and rt[i] == rt[j]:
			count += 0
		else:
			s = set()
			s.add(st[i])
			s.add(st[j])
			s.add(rt[i])
			s.add(rt[j])
			if len(s) == 2:
				count += 1
			elif len(s) == 3:
				if st[i] == st[j]:
					count += 2
				else:
					count += 1
			else:
				count += 2
		i += 1
		j -= 1
	print(count)


n = int(input())
s1 = input()
s2 = input()
x = []
i = 0
j = n - 1
while i < j:
	x += [[s1[i], s1[j], s2[i], s2[j]]]
	i += 1
	j -= 1
count = 0
for elem in x:
	a1 = elem[0]
	a2 = elem[1]
	b1 = elem[2]
	b2 = elem[3]
	q = set(elem)
	if len(q) == 2:
		if len(set([a1, a2])) * len(set([b1, b2])) == 2:
			count += 1
	elif len(q) == 4:
		count += 2
	elif len(q) == 3:
		if a1 == b2 or a2 == b1 or a1 == b1 or (a2 == b2) or (b1 == b2):
			count += 1
		else:
			count += 2
if n % 2 == 1:
	if s1[i] != s2[i]:
		count += 1
print(count)


n = int(input())
a = str(input())
b = str(input())
if n == 1:
	ans = 0
	if a[0] != b[0]:
		ans += 1
	print(ans)
	exit()
ans = 0
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		ans += 1

def aze(l):
	if l[2] == l[3]:
		if l[0] != l[1]:
			return 1
		return 0
	if l[0] == l[1]:
		if l[0] in l[2:]:
			return 1
		return 2
	ans = 0
	if l[0] not in l[2:]:
		ans += 1
	if l[1] not in l[2:]:
		ans += 1
	return ans
for i in range(n // 2):
	ans += aze(a[i] + a[n - 1 - i] + b[i] + b[n - 1 - i])
print(ans)


n = int(input().strip())
a = input().strip()
b = input().strip()
ans = 0
v = n // 2
for i in range(v):
	j = n - i - 1
	if a[i] == b[i]:
		if a[j] != b[j]:
			ans += 1
	elif a[i] == b[j]:
		if a[j] != b[i]:
			ans += 1
	elif a[j] == b[j]:
		if a[i] != b[i]:
			ans += 1
	elif a[j] == b[i]:
		if a[i] != b[j]:
			ans += 1
	elif a[i] == a[j]:
		if b[i] != b[j]:
			ans += 2
	elif b[i] == b[j]:
		if a[i] != a[j]:
			ans += 1
	else:
		ans += 2
if n & 1:
	i = n // 2
	if a[i] != b[i]:
		ans += 1
print(ans)


n = int(input())
a = list(input())
b = list(input())
ans = 0
for i in range(n // 2):
	l1 = [a[i], a[n - i - 1]]
	l2 = [b[i], b[n - i - 1]]
	if len(set(l1 + l2)) == 4:
		ans += 2
	elif len(set(l1 + l2)) == 3:
		if l1[0] == l1[1]:
			ans += 2
		elif l1[0] == l2[0] or l1[0] == l2[1]:
			ans += 1
		elif l1[1] == l2[0] or l1[1] == l2[1]:
			ans += 1
		elif l2[0] == l2[1]:
			ans += 1
	elif len(set(l1 + l2)) == 2:
		aa = l1 + l2
		if aa.count(l1[0]) != 2:
			ans += 1
if n % 2:
	if a[n // 2] != b[n // 2]:
		ans += 1
print(ans)


n = int(input())
s1 = list(input())
s2 = list(input())
cnt = 0
for i in range(n):
	if s2[i] == s2[n - i - 1]:
		(s2[i], s1[n - i - 1]) = (s1[n - i - 1], s2[i])
	if s1[i] == s2[n - i - 1]:
		(s2[n - i - 1], s2[i]) = (s2[i], s2[n - i - 1])
for i in range(n):
	if s1[i] != s2[i]:
		cnt += 1
print(cnt)


n = int(input())
a = list(input())
b = list(input())
uk1 = 0
uk2 = n - 1
ans = 0
while uk1 - uk2 < 1:
	if uk1 != uk2:
		pl = 2
		compa = list(a[uk1] + a[uk2])
		compa.sort()
		compb = list(b[uk1] + b[uk2])
		compb.sort()
		if compa[0] == compa[1] and compb[0] == compb[1]:
			uk1 += 1
			uk2 -= 1
			continue
		if compb[0] == compb[1]:
			ans += 1
			uk1 += 1
			uk2 -= 1
			continue
		for i in range(2):
			if compa[i] in compb:
				pl -= 1
				compb.remove(compa[i])
	else:
		pl = 1
		if a[uk1] == b[uk1]:
			pl -= 1
	ans += pl
	uk1 += 1
	uk2 -= 1
print(ans)


def main():
	n = int(input())
	a = input()
	b = input()
	res = 0
	for i in range(n // 2):
		j = n - i - 1
		l = [a[i], b[i], a[j], b[j]]
		d = {}
		for e in l:
			if e not in d:
				d[e] = 0
			d[e] += 1
		ln = len(d)
		if ln == 4:
			res += 2
		elif ln == 3:
			res += 1
			if a[i] == a[j]:
				res += 1
		elif ln == 2:
			if 3 in d.values():
				res += 1
	if n % 2 == 1 and a[n // 2] != b[n // 2]:
		res += 1
	print(res)
main()


len_str = int(input())
a_str = list(input())
b_str = list(input())
ans = 0
idx_range = int(len_str / 2) if len_str % 2 == 0 else int(len_str / 2) + 1
for idx in range(idx_range):
	a_char = [a_str[idx], a_str[len_str - idx - 1]]
	b_char = [b_str[idx], b_str[len_str - idx - 1]]
	char_dict = dict()
	for a in a_char:
		if a in char_dict:
			char_dict[a] += 1
		else:
			char_dict[a] = 1
	for b in b_char:
		if b in char_dict:
			char_dict[b] += 1
		else:
			char_dict[b] = 1
	if len(char_dict) == 1 or (len(char_dict) == 2 and char_dict[a_char[0]] == 2):
		continue
	elif b_char[0] == b_char[1]:
		ans += 1
	elif char_dict[b_char[0]] == 2 or char_dict[b_char[1]] == 2:
		ans += 1
	elif char_dict[b_char[0]] == 3 or char_dict[b_char[1]] == 3:
		ans += 1
	else:
		ans += 2
if len_str % 2 == 1:
	mid_idx = int(len_str / 2)
	if a_str[mid_idx] != b_str[mid_idx]:
		ans += 1
print(ans)


n = int(input())
ans = 0
s1 = input()
s2 = input()
for i in range(n // 2):
	(a, b, c, d) = (s1[i], s1[-i - 1], s2[i], s2[-i - 1])
	s = [a, b, c, d]
	if len(set([a, b, c, d])) == 1 or (len(set([a, b, c, d])) == 2 and 2 == s.count(a) == s.count(b) == s.count(c) == s.count(d)):
		ans += 0
	elif len(set([a, b, c, d])) == 4 or (len(set([a, b, c, d])) == 3 and a == b):
		ans += 2
	else:
		ans += 1
if n % 2 == 1:
	if s1[n // 2] != s2[n // 2]:
		ans += 1
print(ans)


n = int(input())
a = list(input())
b = list(input())
length = int(len(a))
answer = 0
for i in range(int(length / 2)):
	a1 = a[i]
	a2 = a[-(i + 1)]
	b1 = b[i]
	b2 = b[-(i + 1)]
	if a1 is a2:
		if b1 is b2:
			pass
		elif b1 is a1 or b2 is a1:
			answer += 1
		else:
			answer += 2
	elif b1 is b2:
		answer += 1
	elif a1 is b1:
		if a2 is b2:
			pass
		else:
			answer += 1
	elif a1 is b2:
		if a2 is b1:
			pass
		else:
			answer += 1
	elif a2 is b1:
		answer += 1
	elif a2 is b2:
		answer += 1
	else:
		answer += 2
length = int(len(a))
if length % 2 is not 0:
	target = int(length / 2) + 1
	if a[target - 1] is b[target - 1]:
		pass
	else:
		answer += 1
print(answer)


n = int(input())
a = input()
b = input()
if n % 2 == 0:
	out = 0
	for i in range(n // 2):
		t = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
		f = set(t)
		if t[2] != t[3] and len(f) == 4:
			out += 2
		elif t[2] != t[3] and len(f) == 3 and (t[0] == t[1]):
			out += 2
		elif t[2] == t[3]:
			if t[0] != t[1]:
				out += 1
		elif t[0] == t[2]:
			if t[1] != t[3]:
				out += 1
		elif t[0] == t[3]:
			if t[1] != t[2]:
				out += 1
		elif t[1] == t[2]:
			if t[0] != t[3]:
				out += 1
		elif t[1] == t[3]:
			if t[0] != t[2]:
				out += 1
	print(out)
else:
	out = 0
	for i in range(n // 2):
		t = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
		f = set(t)
		if t[2] != t[3] and len(f) == 4:
			out += 2
		elif t[2] != t[3] and len(f) == 3 and (t[0] == t[1]):
			out += 2
		elif t[2] == t[3]:
			if t[0] != t[1]:
				out += 1
		elif t[0] == t[2]:
			if t[1] != t[3]:
				out += 1
		elif t[0] == t[3]:
			if t[1] != t[2]:
				out += 1
		elif t[1] == t[2]:
			if t[0] != t[3]:
				out += 1
		elif t[1] == t[3]:
			if t[0] != t[2]:
				out += 1
	if a[n // 2] != b[n // 2]:
		out += 1
	print(out)


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree1:

	def __init__(self, data, default=9999999, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
n = int(input())
s = input()
t = input()
ans = 0
for i in range(n // 2):
	a = s[i]
	a1 = s[-1 - i]
	b = t[i]
	b1 = t[-1 - i]
	if a == b and a1 == b1:
		ans += 0
	elif a == b1 and a1 == b:
		ans += 0
	elif a == a1 and b == b1:
		ans += 0
	elif a == b or a == b1 or b == a1 or (b1 == a1) or (b1 == b):
		ans += 1
	else:
		ans += 2
if n % 2 == 1:
	if s[n // 2] != t[n // 2]:
		ans += 1
print(ans)


n = int(input())
a = input()
b = input()
ans = 0
if n % 2 == 1 and a[n // 2] != b[n // 2]:
	ans += 1
for i in range(0, n // 2):
	s = sorted([a[i], a[n - 1 - i], b[i], b[n - 1 - i]])
	l = len(set(s))
	if l == 4:
		ans += 2
	if l == 3:
		if a[i] == a[n - 1 - i]:
			ans += 2
		else:
			ans += 1
	if l == 2:
		if s.count(s[0]) != 2:
			ans += 1
print(ans)


from collections import defaultdict
import sys
input = sys.stdin.readline
n = int(input())
a = list(input().rstrip())
b = list(input().rstrip())
ans = 0
for i in range(n // 2):
	cnt = defaultdict(lambda : 0)
	if a[i] == a[n - i - 1] and b[i] == b[n - i - 1]:
		continue
	elif b[i] == b[n - i - 1]:
		ans += 1
		continue
	for j in [i, n - i - 1]:
		cnt[b[j]] += 1
	for j in [i, n - i - 1]:
		if cnt[a[j]] <= 0:
			ans += 1
		cnt[a[j]] -= 1
if n % 2:
	ans += 1 if not a[n // 2] == b[n // 2] else 0
print(ans)


from collections import defaultdict as dd
n = int(input())
a = input()
b = input()
ans = 0
for i in range(n // 2):
	l = [a[i], a[n - i - 1], b[i], b[n - i - 1]]
	d = dd(int)
	for j in l:
		d[j] += 1
	if len(d) == 4:
		ans += 2
	elif len(d) == 3:
		ans += 1 + (a[i] == a[n - i - 1])
	elif len(d) == 2:
		ans += d[a[i]] != 2
if n % 2 == 1:
	if a[n // 2] != b[n // 2]:
		ans += 1
print(ans)


from __future__ import print_function
import sys
import math
import os.path
import random
from copy import deepcopy
from functools import reduce
from collections import Counter, ChainMap, defaultdict
from itertools import cycle, chain
from queue import Queue, PriorityQueue
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, nlargest, nsmallest
import bisect
from statistics import mean, mode, median, median_low, median_high
sys.setrecursionlimit(10 ** 9)

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

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

def nio(offset):
	return map(lambda x: int(x) + offset, input().split())

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

def toString(aList, sep=' '):
	return sep.join((str(x) for x in aList))

def toMapInvertIndex(aList):
	return {k: v for (v, k) in enumerate(aList)}

def sortId(arr):
	return sorted(range(len(arr)), key=lambda k: arr[k])
(n,) = ni()
(a, b) = (input(), input())
log(a)
log(b)
count = 0
for i in range(0, n // 2):
	aa = [a[i], a[n - i - 1]]
	bb = [b[i], b[n - i - 1]]
	aa.sort()
	bb.sort()
	if bb[0] == bb[1]:
		count += aa[0] != aa[1]
	elif aa[0] == bb[0]:
		count += aa[1] != bb[1]
	elif aa[0] == bb[1]:
		count += 1
	elif aa[1] == bb[0]:
		count += 1
	elif aa[1] == bb[1]:
		count += aa[0] != bb[0]
	else:
		count += 2
	log(aa, bb, count)
if n % 2 == 1:
	n1 = n // 2
	count += a[n1] != b[n1]
	log(n1, a[n1], b[n1], count)
print(count)