#include <stdio.h>
#define FOR(i, n) for (int i=0; i<n; i++)
void run(void) {
int n;
char a[17], b[17];
scanf("%d %s %s", &n
, a
, b
); FOR(i, n)
a[i] -= 'a', b[i] -= 'a';
int res = 26;
FOR(i, 1 << (n - 1)){
int mask = i;
int ma = 0, mb = 0; // character masks
for (int j=0; j<n; j++, mask /= 2)
if (mask % 2) // swap j-th character
ma |= (1 << b[j]), mb |= (1 << a[j]);
else
mb |= (1 << b[j]), ma |= (1 << a[j]);
int cnta = 0, cntb = 0;
for (; ma | mb; ma /= 2, mb /= 2)
cnta += ma % 2, cntb += mb % 2;
cnta = (cnta > cntb) ? cnta : cntb;
res = (res < cnta) ? res : cnta;
}
}
int main(void) {
int t;
while (t--)
run();
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIEZPUihpLCBuKSBmb3IgKGludCBpPTA7IGk8bjsgaSsrKQoKdm9pZCBydW4odm9pZCkgewoJaW50IG47CgljaGFyIGFbMTddLCBiWzE3XTsKCXNjYW5mKCIlZCAlcyAlcyIsICZuLCBhLCBiKTsKCUZPUihpLCBuKQoJCWFbaV0gLT0gJ2EnLCBiW2ldIC09ICdhJzsKCQoJaW50IHJlcyA9IDI2OwoJRk9SKGksIDEgPDwgKG4gLSAxKSl7CgkJaW50IG1hc2sgPSBpOwoJCWludCBtYSA9IDAsIG1iID0gMDsgLy8gY2hhcmFjdGVyIG1hc2tzCgkJZm9yIChpbnQgaj0wOyBqPG47IGorKywgbWFzayAvPSAyKQoJCQlpZiAobWFzayAlIDIpIC8vIHN3YXAgai10aCBjaGFyYWN0ZXIKCQkJCW1hIHw9ICgxIDw8IGJbal0pLCBtYiB8PSAoMSA8PCBhW2pdKTsKCQkJZWxzZQoJCQkJbWIgfD0gKDEgPDwgYltqXSksIG1hIHw9ICgxIDw8IGFbal0pOwoJCQoJCWludCBjbnRhID0gMCwgY250YiA9IDA7CgkJZm9yICg7IG1hIHwgbWI7IG1hIC89IDIsIG1iIC89IDIpC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ronydjugpi
osihzywzgmhriijv
16
eqgxhkjuzdneragm
siesnrmbdvfnojrn
16
jrbggysimxlknvnz
otxdqtxahoyckntf
16
fhhzjbbfwysjmlbu
amupglaulbqwjhvr
16
tdzqxaeiklptefdr
xzclbgcdmegelpnp
16
fcmufxiuwatlcxla
rkrkldpmyysemedh
16
wvbwaouypkywkdgo
icoskdsnhipbdviz
16
dxeaskaixytboayt
bcvgeffdkytkntti
16
cgxsulwlzzutvbey
bzrjdiwxtujfmook
16
tdwmnfatdqiffyzi
cwsqamyqatjvxsqs
16
ckqrohlgevrkygni
poaqdbjhyswbewva
16
rybuxozpnkyojxtv
ggojojrgazcisoge
16
whtjpptwsdylljil
rvhttmuwbnotguyq
16
zvxzxzjjveupfrtb
yckvdmwzxxxushyt
16
ykuwminxaijhnxeh
rjbcqloeoilstlgq
16
bvwizsvnysjglzzg
kfdcayhcprdudbiq
16
zwzwvrzjdwpceohx
fagiyqxifqbuugfs
16
bsdepcmkjpctnxyw
yvgjosomqrlqipkh
16
hggerxqwrcbrfhbb
hdceavfnhlmjnrch
16
hvjfvavqtofzobqy
penkgljhdgdzltac
16
undboadnjxwebeub
sqnsutgdbzzikwaf
16
dzwjmbonmrzdbmbc
hrxvtryivwigwtwr
16
hvfsvehbyqlgajmp
owevbsbqsxynopfl
16
vwbmygszovasjuyi
woqyciwnmildvmom
16
gdsahwetrzbnrlvh
wiqqbqukfeseoobe
16
gijomzamshpaojtg
hdvswmncgfczgvcv
16
dxqapptjkzlxxicc
fmroghrkeizjeopw
16
ycehqeztfjfnmhle
xwjkbgwqbveedpcc
16
iveuvbdhasjbaydv
nktibegxhpopfnlx
16
ubduvuvrunnejaam
exwjcafvznlwaccl
16
uulhbfeqcuddednn
zqtcmvirzeaszqbw
16
ijfkaodtsuxjghln
xwtdaoljwjtgmuon
16
htznxzwqwohjlgay
jcmdifiorpidjkdr
16
xftkcjhygfefccpz
posdmrcxvljoqnzh
16
nwvmwkerxfhbpsgx
vrmrhbnnaffehthj
16
pypasjxngsbabjhk
ltpvqyzckhbdezxl
16
kcpmowrtvetlrkbr
zoqrdgdxlulrmfdr
16
agkygsnomyaaxkxh
ivxoezojqtokbzpx
16
zackcccplsklhwws
foyskpztvhkrjapb
16
ancbsddhklgrmnra
vxcuitshskicklsd
16
ykaksixkvkvmyntp
lacvopedsdmzfpnw
16
kngajauvhbirgkeq
kuveiolkjvwfuyqo
16
umcraiwjzmsffuov
xjvmnvgzepeqtafk
16
jxvccqmeculfhjwo
pocusnkuaplucazd
16
zbvmcqistloyhmex
foxzmuugrctyvylg
16
lfrgjlcspnjgulhl
qlyvyxnvurzshsva
16
wibdpymxklmktoxh
qccatsjnzyaarlnm
16
ysgyapkqdtabopnj
tipznoqiluxsqycx
16
nxjrhzafhlcpjhgn
tpiwhndzrwvuojkk
16
cxaanagekrmfjkyj
wwoftwhfdiohpnok
16
bsffkquthphqsrnu
xrkqptifacnxwquq
16
hoxhpmvtajfmvyro
pssrdhehvutmkrrd
16
oxghuwzqschdutfj
bkmvitwmjoghfehs
16
upsiskgzoyyfdnvd
rhvzwtblgujypmfg
16
fmnobdqacpyghzez
cdgbjkpylastiqen
16
imggrvrcjkuuwuup
roemgtrquhvjlokv
16
qinwquitnnydcgkf
qiwwacxcaorskuyn
16
tqblkvvzioaipfph
fdxbskfzoetkptyb
16
geusivigyeaywmkr
cyiqrtmwedphwxnd
16
ohkkacwmyukavgcn
ciqoxnslejlvdztu
16
cwlmmbbtwfglrzui
zcqdupxeefwjdshz
16
vxnspmuuvhxcqbef
ekoigkuxwtovksky
16
cnjbrcnzrcuamvco
etjfapbwivoysphx
16
vdhoqqtewzpkwapg
dnoibapapeimszqw
16
rnaqbcvwemepsfki
ocsjejeidvegsspa
16
nlcecigmhbnwxilz
tqtbkcnkjheifelc
16
wuxqnqiyqwoakxkm
arcfwjuidiunbncu
16
yfthwdtqfgckrrgq
gsmukgacolqzktgt
16
necgmklodxlvckvt
cswjkkaafdmhptxa
16
jtmcvljthpnjffjr
nsqdzhcmvbfniogz
16
evgiayvofivhwilp
qgnqkcnrcnrkende
16
ctlodpixumeawttk
anuhjwxmcafifekr
16
fwhqzgcrqqtjknib
abnnzwtdfqiahodf
16
moydnmidejmxshxo
llitboxifcbnzmzf
16
fchiudhqoncljsug
mnnhvpbubxzqdvbq
16
dgjlodflufeqxpli
uazwtpoqcpvybtlq
16
oumqwwcwuqjztqdn
onxyvfxdzvwnewse
16
hbzbtwhqrxnuthun
lveasttcxujbywyk
16
ujdoursxtxceetev
eyfqubniaolsdpbg
16
ivbwoazipuxpblcn
huxadaoejafiivgs
16
hsxiyhujvskxrnvf
ppsdjrdnsarojbbj
16
dmlavbbmmlsdulzv
bmoeofuaiuatmowz
16
hidxeshrwqzuyxhp
seijxivbxfzlsygg
16
lhsvnfntzdmixaow
blnmmhwkjoeoyuyc
16
kayfjkqhjdwzuugb
qcrnfyowhadwggrn
16
ssjdtmjaxhzhylut
xsbtnodeeekydxfr
16
mpucczfsskrzknpk
fvwcnpsvepfmzsrv
16
qbzlprtfpnqypike
pozcsbpnrqnoqtqh
16
dxouxplejphbivpw
rjpjrrlikyhgmjzk
16
uagcwdjlqepveiyx
grntwhszkjqgqzrx
16
wflwlpakevfbfxsb
tzpfatffwcjxwjqp
16
mnxuvadbrgdzibqy
liijsksotnmtkbep
16
tuexdxezsvfvajlu
axbczjufbjkzjqbj
16
aqkdozfevhzmgadj
kcbqxnrxoieivvyi
16
klsdcnvvezgdumzr
djudjhxnjluxlnla
16
frqcfsyfhuvneirq
ilonwzgkyjakwiqy
16
vtyvnwitiziwopxu
ugwejnjgziaavnkc