Vasya learns to type. He has an unusual keyboard at his disposal: it is rectangular and it has *n* rows of keys containing *m* keys in each row. Besides, the keys are of two types. Some of the keys have lowercase Latin letters on them and some of the keys work like the "Shift" key on standard keyboards, that is, they make lowercase letters uppercase.

Vasya can press one or two keys with one hand. However, he can only press two keys if the Euclidean distance between the centers of the keys does not exceed *x*. The keys are considered as squares with a side equal to 1. There are no empty spaces between neighbouring keys.

Vasya is a very lazy boy, that's why he tries to type with one hand as he eats chips with his other one. However, it is possible that some symbol can't be typed with one hand only, because the distance between it and the closest "Shift" key is strictly larger than *x*. In this case he will have to use his other hand. Having typed the symbol, Vasya returns other hand back to the chips.

You are given Vasya's keyboard and the text. Count the minimum number of times Vasya will have to use the other hand.
The first line contains three integers *n*, *m*, *x* (1 ≤ *n*, *m* ≤ 30, 1 ≤ *x* ≤ 50).

Next *n* lines contain descriptions of all the keyboard keys. Each line contains the descriptions of exactly *m* keys, without spaces. The letter keys are marked with the corresponding lowercase letters. The "Shift" keys are marked with the "S" symbol. 

Then follow the length of the text *q* (1 ≤ *q* ≤ 5·10<sup class="upper-index">5</sup>). The last line contains the text *T*, which consists of *q* symbols, which are uppercase and lowercase Latin letters.
In the first sample the symbol "A" is impossible to print as there's no "Shift" key on the keyboard.

In the second sample the symbol "e" is impossible to print as there's no such key on the keyboard.

In the fourth sample the symbols "T", "G" are impossible to print with one hand. The other letters that are on the keyboard can be printed. Those symbols come up in the text twice, thus, the answer is 2.
2 2 1
ab
cd
1
A
-1
2 2 1
ab
cd
1
e
-1
2 2 1
ab
cS
5
abcBA
1
3 9 4
qwertyuio
asdfghjkl
SzxcvbnmS
35
TheQuIcKbRoWnFOXjummsovertHeLazYDOG
2
10 9 3
oboxlgpey
yxcuwkkmp
juqeflhwq
sfnxqtjqS
kkudcnyjl
hgjlcrkjq
jnofqksxn
qbhsnuguv
lvahnifao
ebwnnlrwe
35
CodeforcesBetaRoundproblemAtestfive
4
2 7 4
iuqtieo
ysxcgmS
2
sQ
1
1 2 4
bS
8
bBbbbBbb
0
7 8 5
fqiubjpm
qbshcsyk
cjbxpbef
ptwpmapx
ryazscbm
qnvsgzrf
htardzkz
9
uxrmwkayy
0
8 6 4
efvmov
keofnw
pwajpe
knptky
Sibruu
rgdukk
bsxosd
hovgSe
10
ECreruXmsC
-1
10 3 2
ukk
eqt
fex
qSh
tvz
fjn
iol
ehd
nte
gyx
5
cgQxI
-1
10 10 19
owqjcaSpqn
vgrhboqahn
bzziocjmbu
purqsmiSop
xcsifctjhy
ycyytwoamk
rnjfxsxowl
nkgcywcdff
bazljrisqv
kcakigSekq
100
zewpATtssQVicNrlRrcoifTutTAfFMUEfDFKoNyQbSrSYxTGMadNkRpmJvoEqUsqPYgAdQreaUrwDKMNFWiwdRRCcJBPorfMVMoK
0
10 10 26
wxmssptheb
zpxbxsyxsy
qbjkpaywqp
fwhnuzjcgq
ycgaanzedz
jrycrbzqfs
gswwakybus
fhtxhljedz
oSepmyjosv
dwviycevdn
100
yapwUfnyPzgZyFvAHGKWVbXQHkuhJDoUTvCAtdMMCQmKchxKkilUTECOqYJFUSHPqKiRKhDXZgHxwApDWlShdwakmVCgaeKCLOMX
0
10 10 3
rvouufmnqu
byukrnmnhr
zjggwxgvkz
tcagkSitiw
hryajgtpwc
jragfhqoks
kgroxxkuvp
bpgrkqiyns
jbuhjjkziw
omjmbaggsw
100
CpRzrPqPngYvrVJFCWRPMRwrpXcbtiwfoFcAkRaNjzpMMKOQAzBxSrxGbIHaYgmSqhhxhZTmhFttKnhFzRfKxYXshUZRvtKJIzZq
12
10 10 2
friuxvShvg
erslojqtgu
zeqsmdewry
wvhbeeyeSu
gkofbjaavr
twkcdxugps
nzlylSmafu
stamkpxnzt
uwxwximkrm
mzxyboazbl
100
mRIfAtrLKmztpVkAmojDCiIgseBwlUilBIixDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIiFBfaCirbmCa
19
10 10 2
bddahSqkmk
pxbocxayjs
ottvdazstk
laxuidqlqb
kfjwdpdfat
xlipuubkgv
iqyomzfktm
iwbgidmwyu
rngqkeupsf
bqndtekryw
100
MNQgWFLhHycqwjSsbTkbgMYAIHFYARRmOsinYMFjOxxnLjiKfeiBbMpoeTdzUMORPaAxRNfvdAPFaKkPdxdAjjJgGCxkDzmSasqq
37
10 10 2
nxcwdrsmrv
Syjahsosvp
vkrqbxhgbv
wkxywavtnn
epkyoviqbi
sfmpvhuwwq
nlsostrotx
tcdguorhny
imixrqzSdu
xzhdhdwibt
100
UzzaWiRFYbAqxIDMrRBBDoGQhSzSqSLEddAiJsZcxbemdeuddamNYdWOvzlYSCuHIRpnuxdNxAsnZMiLXBYwnrMcrbNeLrUYhZOB
17
10 10 23
htyvouoiqi
vySvsfqadv
xvqyqjyutq
pjcrrphzbk
hlqfyoqfmo
ezcSwleoew
xkwqrajxyg
ngSiftgoso
jyndgicccr
lgjvokydhp
100
JzVVfotldIRcyjhTNRcFlTxFeZKRwavZxYcvdDOQyUvTmryFRuRBcRvmscegtspkPuchqlFEKbrfpTOSlSFOARsbbvSenMwNmaRj
0
10 10 7
ifcwalsdbj
jpykymrbei
rylzgkyefh
oilvvexpjp
iptgodpfim
dSrqejaixu
pksxlsniwa
moSenxtfbc
oqssptcenz
qdhmouvyas
100
qtMDVUXJpSEFgPsLKyRJVRbfVoYaCKJDnQDLFVngVjSPzzVyMnMyuyahMRiBJuNhKtgpVqvukUolLvYEmidvXotgQUJukYwIweUW
0
10 10 1
mdxafehbkr
yuhenybjps
tvfwmiwcoh
jmzrepzjvx
nqyorkSnuk
tSmztmwidv
cmmajnlqrw
fiqewpdwax
uesmkdcplt
lgkomdcqbo
100
mcEQmAvFqKYMXLHQUDeIulkmAMRkIUtbKihTFJwJYQfcAelNrZWSAwHunwZTrdHaRWokgCyLqbubOpEHuZiDVoFHjvkMSoBPyGOI
39
10 10 2
nhfafdwqhh
eyvitpcthk
rpiotuoqzh
nxxnhuaxee
yevrtirzwf
kbtSsamyel
feenjvxsmo
kqpenxjmde
lqsamthlwp
jdyyqsbtbk
100
UHucxPWDaKonVpXEctuqYUAQnrFEZaTYxhoacNbHIMevlbDejXjitEzyVrTfcfBHWRMdJvaTkbkqccyHjtzpTbKmRAXwlXCtFKNX
29
10 10 1
sufnxxpdnx
vttibpllhv
lvbrjmfdjx
gmtexvrnfh
ygsqrsSwxd
kxbbjxgbzs
edutwocmzd
febjgknyai
vcvquagvrs
drdoarhgoc
100
ZoZJXhUWyaLgBTpgbznABKHuyFcKzJmGaMhoKkKfyOGacLwBspaKtAEdwMZJFYiZUFNDxdDIDgKSCRvsbGUOXRqalbpuEqkduYpW
44
10 10 2
cstcrltzsl
blotmquzvj
uiitiytlgx
wumpfdaprd
tfxohqpztn
vfrpsccddo
neegusrkxw
iijfjozqjq
ioegbvuhew
pjjpqdxvqu
100
kPCBONfZLkeXzWVuSgvinPENazcnRoBcUHXwRzPyvNIiDlDSeKOYmiUmjooXuzTCtIRxKDAYeTLgjsenxHoymVazMALUADQpjVjV
-1
10 10 1
qztnjglyrc
nukswgzajl
qnpbdwjvbb
liiakzcrlz
nolwfzzvxd
mqvhiySttx
qwuizSjuto
qbgwiwjukx
komyvblgkc
tkzlxzgsru
100
YUzTZDzLFkMUhjQWbwljJCRyZGFzgJcozvROiwPktRGxkMKiPyiTvhDrtusPYhMgVAOFIjAvlpzcrUvrMrMbhkpUiyAytKfYOGTF
37
10 10 1
mgziiihbkq
iobjknuogh
vntwahSopu
sjsxjpaqvm
wqgrodizst
selzugktoi
vbhfzvgjfn
liqlfdcjhf
bpbtpmimxb
pksfiydpfw
100
wAVZXEhKTuajdCauVTIwgnfbxWuUSmtXkjHZtNVcfTsiSAPLdpdEFdTJLZRjptUcRhAmrNjKMXmuDGatAQoaIpbddnzRGHsJrhoq
39
10 10 2
shbqxycvfm
otydudkttw
qhatsxsngz
ixvyujtyjc
sbvqhnjbak
eggcguuuka
xcydfgjzeb
ytpdkcdrsq
efqlpywggu
fcnfrhnouo
100
HPqtuVckdUOhsnuhnbpekWvWKUnAEaOCihpeEvmaOKOPcIZiMixGJGEuXAaOxuUNyrIesmldLEqGnvyDKPDvFkCbRebCORHmUgeV
-1
1 1 50
S
29
argjhoaiogjiSjqfhjksdvjkSvcvn
-1
1 1 50
S
1
S
-1
1 1 50
a
29
argjhoaiogjiSjqfhjksdvjkSvcvn
-1
1 1 50
z
29
argjhoaiogjiSjqfhjksdvjkSvcvn
-1
2 1 2
S
c
4
CSSA
-1
r_count, k_in_row, max_dis = map(int, input().split())
keyboard = [input() for _ in range(r_count)]
query_size = input()  # Useless
word = input()
used_letters = set(word)

shift_indexes = [(row_index, row.index('S')) for row_index, row in enumerate(keyboard) if 'S' in row]
for letter in used_letters:

    if not any([letter.lower() in row for row in keyboard]) or (letter.isupper() and len(shift_indexes) == 0):
        print(len(shift_indexes))
        print(-1)
        exit(0)

upper_letters = [letter for letter in used_letters if letter.isupper()]
other_hand = 0
for char in upper_letters:
    indexes = [(row_index, row.index(char)) for row_index, row in enumerate(keyboard) if char in row]
    for y1, x1 in indexes:
        if any([pow(pow(abs(y2 - y1), 2) + pow(abs(x2 - x1), 2), 0.5) <= max_dis for y2, x2 in shift_indexes]):
            break
    else:
        other_hand += word.count(char)

print(other_hand)