data = '''9-10 m: mmmmnxmmmwm
6-8 w: wpwwhxnv
4-6 n: trwpnnnvq
12-15 p: zfpmpphpgghpppppppp
5-10 z: bqlbzfzzzbzwsz
7-15 m: mmkvmwmklnqpmggbgn
2-3 z: zzzzzz
9-11 f: fffffffffffff
8-10 l: lllfllllll
1-3 l: llll
2-9 m: mjmmmmmmmm
3-4 m: kmmm
2-11 f: fjdfffmffffrff
14-16 m: mmmmtmmmmmlmmmdmmm
1-5 k: kmvkkkkkq
5-7 g: mghggkgg
5-19 t: tdltgttttqmtjtjgxmp
5-7 r: rrrrrrsrrrrrrrrrrr
15-16 q: qqqqqqqqqqqqqqqqn
1-5 q: qqtpqk
12-13 t: qzgpttrtlttjd
4-12 q: jsvvqxtqhqqgntvvqqpq
13-17 f: ffffffffffffrfffff
14-15 r: rdxktqpprdrshdttg
8-10 t: ttpftttkppxttthhb
1-3 l: hlwlpnc
16-17 n: ntzqkmsnwtqjwtdnn
3-5 m: jcmxmnpfwmxvmdd
16-19 c: cmcccccckkccvcckzccc
6-9 g: gcgggggfgln
5-9 r: rrrkxrrrq
1-3 t: dxcsbvzrrtcfwrh
1-3 x: xpxdbrhd
2-3 m: mpfx
14-17 j: fcjjpjjnmjptnjmjj
4-5 x: xxxxr
10-13 n: nnnpnnnnntntjn
11-12 j: hzjkzgjjgjbvvjjhh
8-17 f: ffhrvbzxfzffhzznfcj
1-5 p: ppppppp
1-4 q: vqqnqjqqwm
3-8 r: rzrrrgtr
8-9 v: vvtnxvdvs
16-17 s: dspssssssscsssssssss
10-13 t: tttttttttttttt
1-3 s: dslp
3-6 w: wglwwxwwwwwww
1-6 p: nppppc
6-10 t: tttztstttbnft
8-13 j: cztwvjhjdmbbj
1-7 w: wwnwzwwbbwwwswwwwtw
7-17 q: qqqqqqbqqqqqqqqqq
4-11 v: vvvvbvvvvvrcvwvvvvv
8-13 d: dddddbhzdddddd
13-16 q: qqqqqnqqqqqqcqqw
5-6 m: mmmmnm
10-18 g: jdpgfxfqlgtcckxsrgn
3-4 b: bbgmb
12-14 l: lkklrcllxlllllk
6-7 h: kvxlzrvmd
3-4 b: kbbg
3-5 v: glgvs
3-6 x: xxxxxxx
1-2 z: zzfnb
5-6 b: bqbbbx
3-5 j: wjvsf
3-8 x: fxxxkxxbxhxnx
11-12 s: vsssspcmqsbzsssss
3-4 v: nvvvc
9-10 p: pppppppppp
7-8 l: pfclnccfn
14-17 c: jcrjhgcccccnsccpc
3-4 p: pjgcpxt
4-8 l: wvlrptdftlpw
6-10 f: hdnffrxfrf
2-5 s: ssssj
10-13 x: xvlcrccxxxbxh
3-4 w: wwwdw
9-15 g: gggggggggggggggg
10-11 f: flxvfffffwqk
5-6 l: lllltvlll
8-9 t: vpdrntgdr
11-12 c: bpxsnvhvfcprpwz
7-8 f: wpgfvvzb
2-6 p: dmccpk
7-11 d: kwdblcxdrmr
3-4 g: ggfzgggg
7-9 h: hhhzcvdnz
4-8 l: ttljxlxlw
12-15 x: xtwwxxxcxxxxxxsx
10-13 d: ddbhkdddddddd
1-4 j: jjvtmc
8-11 b: bbxcrjbmnnbmxfq
3-4 h: hhhh
5-7 n: nnnqwvgn
3-5 q: qxlqvqq
4-9 k: kkkkkkkkkkk
5-8 p: spppxppwpppprppp
3-12 q: qtkqqpqtqqqqqqqqqqq
16-17 x: xzhxxxxxqnxmhxxpd
12-15 q: rsrhzrghndsqslqnp
2-6 z: rzzpzz
2-4 m: mmbm
4-5 g: gfgfq
1-6 t: stttsh
4-5 h: hlhnm
12-13 d: dddddddddddpd
9-10 h: ghhhhhhhkchh
10-15 r: rvgxrrcrrwrrrrtlrrr
5-10 l: qltclnnblcrlv
11-17 p: ppqpppvjbrpppqpppjw
9-12 g: xghzsgmkggtg
13-15 t: jtdkhqttstxbztstt
14-18 c: chcvxpcxccxckhcddh
12-14 d: ddddddddsddddd
4-8 l: rsdllblllxl
4-9 m: xmrzbmrmhbsm
2-3 s: ptcp
5-8 p: mtxhpvkpkrzhhjxpp
4-6 w: wwwdwj
4-6 w: wwwlwf
6-7 l: zllntlr
10-14 d: dqdddddddndddvddd
2-6 f: dfpjwfgrfwlsc
3-5 n: lnnxvq
4-19 b: bbbbqbbbbbbjbbbsbbbb
4-12 s: mmlmthslfcnnrwkh
2-7 d: ddddddd
3-7 j: kpjwjjj
7-8 p: pcmchppp
4-7 f: fffvffgf
4-7 d: ddmdfcv
13-14 w: wjwmwwxwfmpdpf
5-7 d: ddrdmsh
4-5 r: rrrrrr
4-5 g: ngsvg
7-13 g: gggggggfggggggjg
6-10 m: hbsqkpmfzss
8-10 p: kppkdpptpmpnpl
3-4 l: llll
11-12 s: ssssssssssqksq
15-16 d: gdmdwdrzdkctddzv
7-13 d: ddddddddqdddjd
7-8 t: tdtdrglm
3-6 s: sskssz
2-3 n: nbnmrnxxfwqbdh
1-4 l: wlxlllllllllllnpl
7-8 v: khcxvvfd
14-15 j: jjjjjjjjjjjjjbf
1-7 n: ndncltg
1-5 l: dllzmg
3-4 p: zpzmp
1-6 b: sbbbsb
11-13 x: twcxxxxcxxxxd
3-4 r: rrrtv
1-9 z: kzvlzlnznzlhbdp
5-11 q: qfbqbqnsjds
4-5 b: wcjbb
2-4 b: bdbn
3-12 g: zftzmsbsjgggw
11-14 h: hkhhhdhhhdfhhhh
1-2 z: zzbz
6-15 z: zznzzzzzzzzzzzzzzzzz
6-9 j: jjjjjwjjm
2-3 h: glghhh
16-17 r: rhhdnrjrrbrgnrqjb
2-12 j: jzjjchndjjbcfhmqkmn
1-4 n: dnnn
7-12 w: wswwwqmswqwcl
3-5 g: ggvgz
1-3 c: ccccmczccq
4-8 k: rhckkkkksvkdkmkkvbrk
7-11 j: gjwjhjjpsfqxnjd
3-4 n: ndnjn
3-4 b: gsbhb
4-5 z: zzzzzz
2-12 f: zltmcbkcvlsfjsm
8-11 g: gggggggtxgmg
8-11 l: lllllllllllll
1-18 d: ddmlltqflhkpjdxrwdn
3-4 h: hdhhh
3-11 w: djwsxklbrbptcfcwcrch
7-9 m: hshmlmmmmv
11-17 d: dtcdddddhdjprmqdjb
3-6 c: ccjccccv
12-16 r: rrrrrrrrrrrrrrrrr
4-5 p: hvpnc
2-11 z: zzznvrzzvzzz
6-7 s: szfswss
19-20 p: pppppppppppppppppppp
1-11 b: bzkqmnbbwmkczz
15-17 d: ddddddddddddddddd
5-12 s: xsskshskfvkrmsssv
2-17 r: rrrrrrrrlrzrrwrrr
5-8 c: cccclccn
7-11 k: fnktjpzbcckjnqvmmnl
4-5 c: cdzhcfvsc
2-8 f: mfsfrfbs
11-12 r: rqhjgnsrrrlj
5-7 r: vbfjpzrr
2-4 d: dwjl
5-9 f: ddffrrfffffnfjr
1-12 h: whghdlghthlxjmg
5-18 p: lpppqplhsxpppppppqx
9-13 q: xqkzksbsrgsqq
13-15 l: llllllllllllllll
9-11 p: whpfjshkxcjf
6-7 g: gggggfbg
10-11 b: bbbbbbtbbbb
2-4 n: tnhn
12-13 q: fqqqqqqqqqxfvvqq
6-7 d: ctddrqw
6-8 n: nzwnnzvnnnnrr
10-14 w: qjlxjwdqzgthzs
6-14 n: qnpznqnqdmnnnmcmqrbh
6-19 r: lrrmrprlrbrpztrrrrr
3-7 p: pwppghpp
6-12 l: llllllllhllllllll
11-12 n: nnznnnhnnnnn
17-19 b: bbnbbbbbbbbbbbbbrbj
8-11 d: dfddfdxdddd
4-5 w: wwwxl
2-8 v: xzvvvvvcvbvlz
6-7 t: ktttwct
2-4 l: wltlc
5-12 d: kqmpddtfzlfddsd
3-4 r: rrrg
1-4 k: dkks
3-6 v: vvtvvh
14-15 c: ccscchbcccccccc
2-8 v: svvvhsvv
11-14 g: gggggggggggggggp
8-10 v: vvvvvvvvvvv
7-13 g: gggggggggccggg
8-10 v: vvvvvvpvvv
1-3 d: dddd
5-6 w: vrnpcw
9-12 w: wwgwfwwwwgmw
7-11 w: wwwwwwwwwwww
1-4 f: fwft
6-8 n: cnnbpnnnctnnvnldnj
8-17 r: jrrmrrrfrrdrrjrsdr
5-7 r: rrrrhrtr
5-6 z: nxwtzzwlsmngkjzjgs
5-6 q: qqqqqq
4-5 c: sskrxc
3-9 f: sjfstwfpffcdhfftbfvt
1-4 z: zzzzzzzzzzzzzzzzzzz
5-6 f: xmnfffb
1-3 z: nzdzzz
8-13 s: sgsgbsssbsbsssk
5-7 v: vlbqjhrmbvw
9-10 w: wwwwwwwwgfwxwwwjwwww
5-7 n: nkvqnnnn
3-14 b: mzkkbbcbbmgxvbp
18-19 h: hhhhhhhhhhhhwhhhhhh
3-6 g: ggjvggggm
11-14 c: ccccjclccccdcccncc
5-7 x: xlckxxx
2-5 l: lrlll
10-12 t: tttttdtttztjt
1-4 c: cpkctsjp
6-11 c: cccccccccccc
6-8 f: cffvnrkfqmfffr
8-10 c: cccmcccccc
2-4 m: fdhdkxfmlz
5-7 g: gggggjgggg
13-14 v: vkhvpxdthvdvnrl
6-12 c: cccgcrcchccqzsqsc
7-8 w: wwwwwwcrwm
12-15 s: smmfsspsspsswss
7-14 p: pxppsmppppppgqmpppp
6-13 z: pjzzdzshcdgzcslr
8-10 q: qqqqqqqqqqq
2-4 p: ppppp
10-15 t: hqtttttqtltvttsttt
8-10 g: qrvfmmggsr
6-7 d: dddvdvdd
3-4 q: qqkcq
1-2 l: llgwzclzl
7-8 h: hhhhhhgfhh
2-4 f: fkcpq
3-5 r: rrrrrrr
5-7 p: pppppppkppwpk
4-5 j: jgcjj
8-9 g: gggggggggggvggg
7-10 p: pplppptnpn
8-9 p: pppppppwpp
4-5 k: skkkk
11-17 f: fkkffknfspfkxffvf
3-14 x: xxmxxxxxxxxxxjxxx
2-4 r: ndjpbrgjwsfpqlnrcr
8-10 w: dgwzwwwdwtww
6-7 l: mvdftllwnzxdwhcvl
9-11 v: vvvvvvvvmvv
10-11 z: pzzzlsfzppzzzzzlz
7-8 w: wwwwwwww
3-5 r: rrprrr
10-11 z: zzzzzzzzzzzvz
7-8 q: qqqqqqzmqz
9-10 g: dggggggrqtgg
4-10 c: cccfcccccz
5-12 g: hfwkqmgxszhl
1-4 q: dqqrqq
1-10 v: qvvvvvvvgvvvv
6-7 l: rhllzllll
2-4 s: sssssq
12-16 r: rrrrrrrrrnrrrrrrrrrr
1-5 w: wgwzc
12-13 l: llhlldlmlllllll
4-8 b: bbbbbbbkb
1-5 p: ptpsp
4-6 d: mjvdld
2-6 m: mmvgtms
3-5 d: rrdfdrddzw
1-5 s: ssssss
8-11 f: qfflffffmffffffftx
2-10 x: xxxxxrxxxxvxsxvxgxwx
3-5 v: vkgqv
16-17 h: hthhhhhhhhhhhhhrh
4-5 b: bqplb
3-5 b: txbbbqsbbksmbp
16-17 q: nqjqqqqqqjdqqqqgl
4-5 x: xlxcfxx
15-16 x: xxxxxxxxxxxxxxmg
15-17 t: tkkttwttttttttttttt
6-7 v: vvvfvvvvvvvvvvvvvvvv
9-13 j: jjjjjjjzvjjjpj
6-11 s: sscsscswsfnsss
1-2 c: cnpl
17-18 v: vvvvvsvhvrvvvhvvqc
6-7 j: jjbjjjjstjg
5-14 g: gggmxgngggngggl
2-4 b: bmbwbs
11-16 v: cvrtvnvqvvcvvvvwv
16-19 c: chccgvlclcnncdfcxcn
1-2 g: rngb
5-7 j: jjjdfjjjjj
5-6 g: ggfghx
1-2 m: pmgndcmg
10-12 w: cwwwwjhznwcwswl
1-2 z: zzzzzz
4-5 z: hxmzh
1-2 t: thwxshrtldtvg
8-16 h: hhhhhhhhhhhhhhhhhhh
6-18 q: qqqqmqqqqbqxqqqqqqqq
4-5 g: gjjgq
3-12 x: txxxxvxjnxxxxxskhh
1-15 f: fffnqfwrffhffff
7-10 g: gpggzgggdkk
4-8 v: vvvgbvvbzv
1-6 n: cnqnnnb
1-3 k: skzkkdk
10-11 z: zzzzzzzqxhzt
7-16 p: sppdxpdzppppdpvj
9-10 n: nnnnnnnnfnnnnn
3-9 v: vhvtkxzxvjp
7-15 h: rtvchhhhhpdlzthz
5-10 d: njqvdnrdddvptdf
1-5 t: ttgzttll
3-7 l: zwzbwtdllsznz
5-8 t: btvtthtttd
6-7 t: tthtttb
3-17 s: zslvsbrlnqshsrgss
4-7 f: fffffff
2-5 v: vvvvgv
2-4 r: crrr
8-9 k: fklhhzskk
5-9 d: dbddjdddkddddd
2-5 z: svzkzbbkmj
2-4 f: lgwf
2-4 q: mvrzbd
6-13 r: trrrrrrrdgrbrrrjrrx
16-17 g: ggggggggggggggggg
6-15 p: mhpcppnfnplhzjphs
5-10 l: nvllkslllxlllzlj
3-8 l: dclccbslwlslqlll
4-8 v: vvvvvvvv
14-16 v: svvvnvvxvvvqvvvn
8-13 z: zzzzzrmzszfzpzzznzf
9-11 f: ffffffffnfc
4-7 q: qsxfqqc
2-6 h: nhrnhhx
8-12 k: mbkgxkvxqqkk
13-14 c: lclkmkmcdxscww
4-5 p: pppppp
2-4 l: lbzmpv
3-4 g: glggngprsgr
10-15 b: bbbbbbbbbbbbbbbbbbb
11-17 z: zzzzzzzzzzxzzzzzxz
7-8 q: frvqpggq
9-10 f: fffffkbffff
3-12 j: jjjjjjjjjjjjjj
4-5 j: jjbkd
1-2 m: nmdmmmmmmm
14-16 w: wwwwwwwwwwwwwwww
5-9 r: rrkrrwhrrr
2-3 h: hcfh
15-17 w: zmwwwwwwgwwwwwwvwwww
8-13 r: lzfczkplgdpqz
13-14 z: qzzczzkgzzzmztcz
8-9 k: kkstkcrkkmjbklk
12-13 w: bkxwwwwwzwwwwwwwswx
7-8 x: xxxxxxlvxx
2-4 l: wlllsllll
5-6 c: cmccccccv
3-4 p: ppvs
5-12 s: fssssldsssxpvsx
5-12 g: jvqrggdbglpgggkkxgg
7-8 g: ggxgnjgggzbgjg
8-9 p: pcppppppp
5-14 f: bfffhffffhfsfff
2-5 f: fffffff
3-12 x: pxxxxxqkxhdqk
10-13 r: rrrrrrrrrrrrrrrrrr
6-15 x: nmxsfhbcvgvhxlx
5-9 v: vvvvvvvvv
3-5 s: ssdsss
10-15 n: cncwgtrhbnxpkwqzhvdn
10-13 j: nfjjzvzjjqtpx
12-13 j: jjjhjjjjjjjqr
9-12 h: hhhhhhlhhhhhhh
9-11 l: ljlllllfgvlll
1-4 p: gbpp
6-7 x: xtxxxhj
2-17 v: vvvvvcvchvvtpvvvp
1-5 c: bcccgc
2-5 p: ppbxp
2-3 w: wwwjwpjdjw
12-13 p: pmcppzwpkppppppppd
17-18 w: zgbwwwwzdwwswfxcgn
6-14 z: wzlzbdzzzzmzqspbcn
9-15 q: cttgqzglzxdqjhd
1-7 j: rgjrjjjjj
6-9 t: tttttxtttttt
3-5 d: rqkfq
3-12 c: cckwqckkcxcmwvnkz
7-8 z: zzkzdztgzz
3-5 t: wttttt
15-19 b: bbbbbbbbbpbbbrbbbtb
10-11 p: ppppppppprspphppp
5-7 v: nvqvbrfbd
6-8 n: vnnbhgnhn
7-11 r: prfrrhshrszrssr
4-5 z: qrszzht
7-9 z: zzzzzczzzzzz
2-3 l: lxtb
8-10 f: ffffffrfff
10-11 q: qqbgqqqcqqqq
2-9 l: gmflclltxcllzm
8-13 k: xkdglwzksvvdsjzp
7-8 h: hjkbfhsc
13-14 x: xxxxxxxxtxxxjbx
5-14 k: kkgkkkkkkkkkkkkkk
11-13 g: gwpggggggvxgzggg
4-6 j: jjjjfj
2-3 b: bxfb
1-2 k: kkkp
9-17 g: ggggggggkggggggghggg
3-4 p: nzpb
5-6 f: fbtfffv
4-10 h: hhhrhhhhhhh
3-11 d: wtddsbhwgfjmtlb
8-9 n: nnnnnnqrm
9-14 c: vchcclvtncscczbccw
7-9 q: qqqqqnlqqqqq
12-13 k: kkkkkckkkkkdh
4-9 v: vvvvvvvnvvvv
2-5 z: hhkzmwhzdfczf
4-5 q: qqqqq
4-12 g: gggggggggggggg
15-16 s: tnrtkspsszsmsmvs
13-16 h: hhhhhhhhhhhhmhhjhhhh
7-9 f: nhkmvtmfdcnfxflk
10-12 t: ttttttttsltw
1-5 t: nttttt
7-8 q: qqqqntqbfqq
6-10 z: zzzzzzzzzrz
10-17 k: kkkkkrkkpkkkkxqvkkdk
2-6 w: wqswjnwkx
9-18 l: fvhwjrrvnfzqvvhdwkpj
2-5 t: rqpxmqmnswvbtp
15-19 l: lfhlllllcbklgblllll
12-13 x: lxzvxxxxxxxrcxxtxxx
4-5 n: nngnb
5-14 j: jjjjjjjjjjjjjx
3-4 q: nqqqb
15-16 p: ppvpppppppppdpfqp
2-10 k: kkkkkkkkkkk
7-8 l: mllllllc
19-20 w: wwwwwwwwwwwwwwwwwhjb
2-4 t: rzmdfqjv
12-13 g: gggkggggvgvgtgg
7-12 b: qtjbzqbxbvsbwz
6-16 d: wmpjjddmtctmxbqd
13-15 c: fcznfkxzkftcfcfj
19-20 n: nnnxnnnnnnnnnnnnnnnn
6-8 x: gmgxxjxmxx
4-6 q: qqqqqpqqqdqqqqqq
3-5 c: cbcdc
6-7 k: ktwkqrkfmkpkkt
9-12 p: ppppppppqpwpp
16-20 c: cccccccccccpfccdcbcl
6-9 q: qqqqqzqqtfq
12-15 w: wwpwwwvrwwwwwzs
9-10 d: zddddhdfdd
11-12 c: cclkzqccxbccglgc
6-11 v: fzswbvbvddvpw
4-11 j: vnkjmztfjvj
2-3 h: jhhp
8-9 r: rrrrrrrrr
1-10 d: dddqdxdxdv
3-9 m: cmmpvmmhmmx
6-7 m: kpxtcmw
2-13 s: scjxbvrxfldhvf
3-11 w: wftqlhxsqhkwxwscrgvp
2-3 r: rrrq
1-2 t: tttd
6-7 b: pbbbbbbbbb
2-6 p: fkxlxnwpmxgtzv
12-14 w: wwlwwclgwwwwwxwwm
4-5 q: qqqkwq
11-16 q: qqqqqqqxqdqqqqqn
2-3 s: sgmmkxgs
4-8 z: zzzzzzzzzz
2-10 g: srnlfvgfdwcjqdspwt
7-10 f: fftfsblffj
5-8 b: sbbmbbxb
4-8 s: hmpvsdsssvsczpw
1-4 h: hghphn
3-7 r: glmxmlnzsfvlr
6-8 n: hncttfmt
3-5 w: wwwww
12-14 f: fhgfnffmmbfjlfq
9-10 q: qqqqqqqqgq
6-7 k: kkkkklkkkckkkkkfk
2-5 s: ssssss
3-8 d: ddlddddsd
6-9 k: kmkkvkkqkjfnkkkk
8-9 p: qpslppfhx
14-15 j: jjjjjjjjjjjjjch
2-5 z: rbqmznmq
7-8 w: wwwwwkwdwnq
4-7 t: cshbkttttt
1-2 f: fqffvffffffffffh
4-5 p: lfpbnvnbjsznxdpwp
1-2 w: wwdczgfzhv
16-19 p: ppppppppppsprpppppwp
2-11 f: mfdlhdgflgz
5-6 h: hhlhvj
2-6 n: nntjzn
3-4 w: wmwj
1-11 g: gggghgggggggggggg
3-4 g: jgjk
2-5 s: sjsss
2-3 h: bkhk
2-13 h: kbkbsjlvqxhfdwpstn
8-13 m: mmmmmmmkmmmmmm
19-20 s: sssspsssssssssssssss
3-7 c: jrrtcgx
15-18 m: mmmmmmmmmmmmmmmggm
5-14 x: ljxbxxxxxrnxxx
14-18 d: pddddjddddkqdmdddcd
1-19 d: tddpndddqdddddqgddd
7-14 b: jfbbcbbpgdbvmb
1-7 h: srvgwthwhhhh
1-4 n: xhqdfnnng
1-2 v: vbvvczs
10-14 g: gggggpgggfgggg
11-14 d: cnddvxddddnddldmf
2-3 d: tddzccmml
2-4 x: whfvct
2-5 s: cshcl
3-11 k: ckgkkkxzkmzjl
10-11 m: mmmmbmmmwkmm
11-12 g: gjwgggnbgggggzggjg
2-16 j: qkdlpxzmqkhxxxfskj
8-9 h: hkhxhhkqt
6-7 w: wwdswwwwwcqlw
2-9 w: bwsgvbwjrv
17-20 t: hknjzjzdwsqkbktkqfts
1-3 c: cjcsqfpgjppcccn
8-9 n: mnnnnznzngnnt
6-8 k: lgckxwkk
3-6 l: lsnldll
8-13 s: svsscsfcdsxvlksxtk
5-6 t: xttzsvtt
9-13 t: ttttstttvjbtr
3-4 s: sqxss
6-14 s: ssscsssssdssssssts
2-15 t: ztddqtbtttlfhttttpt
6-8 b: btbbbvbm
6-8 l: llllllllsllll
1-4 l: zlcv
10-15 f: bfstdfjfffmffffffgc
4-8 z: zzzbzzzvzz
5-7 h: qhmxhkhsjmwzkvh
8-12 f: lfffqffxfrfd
5-14 c: kcjbzhcfmrvrxkpnjd
5-7 b: bbbblbb
3-5 t: tgthtt
5-6 s: ssxssspsc
4-5 z: wzhzz
1-5 b: bbbbbb
4-11 j: sjtbrnspzndg
1-8 g: lbscqdrdtqgmtsg
4-15 c: cdccnpccscclcccccc
4-5 s: smsssz
6-9 b: bbbbbtbbqbk
10-13 h: hhfkhhfhhmhgq
3-4 s: hhsg
12-14 s: ssssssssssssssdss
5-6 w: qfxnvk
4-8 v: fvvvvvvvjs
5-11 f: ffffffffffnff
7-16 d: knfdxddwdddnwdjdddl
12-13 d: dddddddddddrw
16-17 w: wsxwwwwwwwwwwwwltw
6-10 w: wtwjcsjwhgw
2-7 v: spvscsxhjfjfdff
11-14 k: scpskhmkwkqhzm
16-17 m: mqmmmmmfmmzmbmmwg
11-12 p: pppkppppqwpc
2-11 d: ddgssqrdqqdd
5-18 z: wrghzskqlgxqmqczsxvf
13-14 t: tzttttvftrttttkj
12-16 w: hxvdgjwsbclrmrtwxc
1-11 x: bnxdfxgfxfq
9-10 k: mwsnrdbcqrvxlk
1-8 j: qprjjjzlj
17-18 f: fjfffncffffwfdxfgvfd
4-5 j: pjjjc
1-2 j: jjjh
2-4 v: tvpv
8-12 x: fxxxxxxbxxxhx
9-10 f: xfffffffffffffffjnf
1-5 k: vkkknk
3-4 s: qtsrfsvsvsrtc
5-6 z: zzmzkj
1-12 n: snnnnnnnnnnnnnnnn
2-5 m: mjmml
9-11 n: nnnnnnlnnngnnnv
2-3 x: fxxxxckxsrlwhc
5-15 d: rdpjlddjdrddxbddt
5-17 c: bccbbckwvcrmdcqcctcc
6-8 w: wwjwwswrwpnwgxnd
7-10 p: pppppppppppppp
3-18 h: hhlhhjnwhhbhhzhhhthj
2-7 b: llbbcrjbnb
1-6 s: ssbssfkss
2-3 m: zhnmd
10-12 t: ttlttzttllbjtttttt
8-10 w: wwbwwwwwmw
4-5 r: rrrfh
1-4 l: lfblrlpzzlqljlsll
3-4 c: cwcjmh
14-16 h: hhhhjhhhhxhhhlhkxhh
7-8 m: mmvcmqmdmkbmmmn
5-7 m: dwmqmmmkmkm
1-4 d: ddddm
12-16 d: dqlpddwndmrdvdmdghdh
18-20 v: gzqvmvzvcffwbfnvhmnq
4-5 c: cckcc
9-14 x: xxxxthxxgjbxxrx
6-12 z: vkxzzjzzzjfp
11-14 h: hczhgqsbsmtrhf
6-8 x: kjvscxnxfvxbmgnksxq
7-9 k: kvffnskdkdq
6-7 x: xxxxcxx
6-12 m: mrmmmcmjzmftgmmtm
13-17 f: ffqfffffpffqmfnhgbf
8-10 r: rrmjrktmjbrrrrsl
8-13 c: cccccnnrccccvqcnclcc
1-4 t: tttg
13-17 j: jpjjjjjjjjjjtjjjtjz
3-5 r: rrlrl
3-18 c: cjshpccrvfxggcfjsfwq
2-7 l: ldlrxqqbqllgj
1-3 v: bvxr
5-6 t: tttttt
17-19 b: pqbmnhbksnqqxbhlxjcr
4-5 p: ppppp
1-4 m: mmmmmm
1-9 b: vbtbbbbbbfbbqb
6-10 j: fzqldjzgdjrjt
6-7 w: wwwwwwzwwvww
8-9 r: rrrrrrrrrr
5-8 h: xhvjhhlhdwvh
7-10 w: wwwwgwlwwgwwww
5-9 f: lvvfcfqffv
4-6 n: nnnnnr
2-3 c: wdbq
19-20 l: lglllllllllllllvllrl
5-9 z: zzddzzzwz
3-4 d: dkddvdd
10-14 f: fmffffffrsfnfx
4-5 p: pvpwvqplmprp
4-10 c: ctclccccvbcccc
5-6 h: hhhzhh
7-14 g: ggggggggkgggggggwgg
8-11 b: bbrbbxbgbbb
3-4 q: qpxq
2-4 z: xkrv
2-3 m: mmmm
9-10 w: wwwwzwlzwcwwbpfrrf
7-12 t: kthhmbddtbhs
2-4 t: tttjtt
5-7 w: xvwwwwww
10-12 g: gdmgghnkmgggmwjrlgjj
4-6 j: jzknjjt
1-10 v: vvvvvvvvvc
8-11 w: znmpmrffmswnqw
7-12 w: dxpvfwcgwwwwwxwww
3-4 z: zbzzt
4-18 r: frqhkrqbcttrdqkgnr
9-12 s: dssxrzjsfssv
2-4 w: fwjw
11-13 r: kdrrrrrrvrrrqrprr
7-10 g: gggggggggg
1-5 v: vdvvv
19-20 s: vmswvsbspsgsvszssbss
4-5 q: qqqqqq
6-9 l: llrdllwlwlll
9-11 m: mmmdmmmmkmhgmkmmmm
1-3 g: sgfg
12-14 g: gggggggggrggpgggrb
6-9 x: zdzplkrxxkkrjpxnsdzl
14-19 h: htclqdvhdzqhxbhzhkh
2-4 m: wmmmt
3-4 p: sjpp
3-4 h: hhrx
2-3 r: zhlzpzc
14-20 j: nffzpjmqrjbjjfjjmcjl
4-6 w: wmpjwzzd
7-8 q: qqqqqqqq
4-5 n: rgcvfnbn
3-4 g: qgmcgs
4-8 v: vvzlzxhclv
7-8 g: szsgfzgqjnj
12-15 w: wwwwwwwwwwwwkwd
11-12 t: ttttjtttttpz
5-6 q: gdmrqq
5-7 w: nwwwwwrw
1-4 s: srpm
14-18 w: wwwwwfwwwwwwwnwwwrw
7-9 z: zzzsznjzrfzw
3-18 v: vvxvvvkvvvbvvgjvvvv
2-16 p: mmnsdmhhkfqplzcwq
1-2 h: hhlmvhw
7-8 n: nnnznqnn
3-4 n: hnnn
5-6 p: zvbdhnpkcpggvlxppp
3-4 l: lljgll
1-5 d: ndddmddddd
3-4 t: dttt
4-5 m: wmmzm
6-8 m: mhmmmvmwm
8-11 b: wxzvmmvbxqbjb
18-19 x: xdtszmmqxlxzvxgxwvj
15-19 r: rrrrrrrpwfrrrrrrrrrr
9-17 j: jjjjjjrjjjjjjvjjjjqj
2-5 t: nmxwtthqstg
9-17 h: chjkngjkkrnkhgtgv
2-4 r: rrrr
10-16 l: lpdlllmsllfkllll
2-4 g: gxgmg
4-5 h: rnhhh
2-5 j: jqnvqlntsccr
2-6 x: dxdxwxfxfnxx
5-19 s: fsnpsdhkbqnscbdjphf
5-10 v: hclvbnmvwvvcvsgxbdcv
2-10 r: gfczjcpjbdlf
4-9 m: mmmxmmmmmm
4-14 b: bpjgdxbbbvbgbbbb
6-8 w: qhwwbwwww
7-10 x: wjxzxxxfxxs
7-9 w: hwjdwfjgqcwhlwwwwg
3-8 v: vbvwpnmv
1-9 h: chhhhhhdnh
3-4 l: qgllflwhsbq
6-9 q: qzqkqqzqqlfmfq
3-12 m: mmwmvmmmmdmmzlbtmr
3-5 n: nnknwn
7-8 b: bbnbbbxs
2-4 f: fvljfff
12-15 w: wwwwwrwwwwwwwwvwwww
2-4 g: gggmg
1-2 w: wwxwqw
11-18 s: sssssssssscqsssssn
12-15 r: rrcrrrrrrrwlbgrh
9-14 t: ttttwsttrnttthtt
4-5 n: nnnnnnnn
15-16 w: wwwwwwwwwtwwwdwww
7-12 g: qfgjwcggglgggwmlhr
1-15 z: zzsphzzzvzzzbpzzz
14-16 l: llllllllxlllljlsll
3-4 x: xxxx
3-6 w: dhwpjw
2-7 v: zvvkxcvbtwx
2-5 x: whpfx
4-6 f: mfndfc
5-7 z: tznzzzn
3-5 l: jtllld
15-17 d: jbdrdnlqdbdlvzwhbdz
14-18 d: ddddddddddddddddddd
3-4 c: vlvsqxcmjsk
10-14 b: bpbhbbdvblbsfbbrdb
6-7 g: dgmchcbmhhxcbvg
11-15 d: ddddddddddndddqddddd
3-11 g: ggxlggggggfgg
3-5 g: gcrgw
4-8 q: xqlqrqqkk
3-4 x: zrqndxxxf
4-9 l: llllllllcllglll
4-6 d: bdddddztdbd
7-9 s: zkghrssxm
4-6 x: xgncxfx
8-9 c: cccccccwn
9-10 m: mmmzmmmmmmhvm
4-5 c: cvhcc
2-5 k: kfkqgxqfk
16-18 s: ssssssssssksssssss
4-5 k: zbknk
3-4 h: hjdhcfsv
4-6 f: lfrfdfhfqf
2-11 k: kkkkkkktkkkkkk
1-9 f: fkwtffhffxftdfz
8-15 b: bbbbprztvbbbkbbbbbb
6-10 s: ssssfwssswgk
11-12 t: trcthtmljttv
3-4 s: svss
6-8 p: ptpppzpldvcdbbbpwmjg
11-17 x: cxpqbxxxxbxxxqxxn
11-14 z: pzzzzwpxnzzkzzz
6-7 c: ccccccc
1-2 z: grzzz
8-10 d: xgmswdsvtb
7-8 c: kcccccdp
12-13 f: btcnxsclqznxmf
4-11 k: grhkjkkkkkkkkpksktkk
15-16 z: zzzzzzzzszzzzzzz
8-11 v: vvvvvvvgvvlvvvvv
1-2 c: qqccc
2-4 w: nvkgzdfw
3-12 f: bfvpftfffwdfff
5-6 h: wghnhtvzhhz
4-6 v: vpvmvp
5-9 z: nfgwzzzszz
10-11 b: bbbxbbbbbbbb
6-7 g: ggnggzw
2-6 c: bcrccc
1-13 s: dsssssssssssls
1-6 j: fjjjjcj
4-14 p: pzvfnpfppblfjngpkzj
1-2 p: pppv
4-5 t: gttsktt
3-13 w: wwwrbwwwwwcwwwrwxg
12-14 r: zrtrdrrrjrhrmrl
5-6 b: bnbbbwbbw
13-19 g: ggqbhgfggfpgqgggggx
11-12 b: bbbbbkbbbbnp
10-11 c: hcvccchqshj
6-8 k: krvlcfkrxx
5-13 d: dddddddddddddd
5-7 w: wwwzbwkhvwwm
6-10 z: zzzzznzzzrzz
11-12 h: hhhhhhhthfcr
9-13 t: ttttsxtttkgtttgtt
11-13 r: nrrrrrrrrrprtrrrrrrr
16-17 l: kllllhlllllllllzdl
4-6 w: wwjwvw
1-3 j: mjnxbqvzfjgjsjr
7-8 t: pltpspvt
5-13 m: lmzmmnqfmmjmtm
1-15 d: djxhfqjwjmdndhg
4-6 r: hkrrrrgsdsx
1-7 r: srrrrrrrsprh
3-6 g: dbgtqwkwkgzqxbgbgkh
15-18 s: sssslrsspssssszssp
8-11 q: qqvkqpdqdqqz
1-3 c: cccscccc
5-9 d: wpfzlqnsdrtlvwnd
7-9 f: qrdblxfnf
3-4 z: flzz
11-12 c: ccccccccccpwc
3-4 v: ltjwvcv
13-15 p: ppppppppppppfpp
14-15 r: zrrrrrrrbrrrrrkrr
2-5 n: lnwnnsmfd
4-7 t: ttctrtt
5-6 w: hsfpwcwrfwxmwww
5-8 b: bbbbmbbfbb
1-3 z: czzp
4-6 h: hhbhhh
16-18 j: jjjjjjjjjjjjjjjjjq
1-2 n: zdlwqzlnnp
5-16 m: mmmmxmmmmmmmmmmjm
3-5 h: hhlfhghhhjh
2-6 f: vkfbpf
5-6 j: jjjjjjj
4-8 q: qdmzqlln
6-7 x: xpxxxjtxs
2-5 z: znzzxq
8-13 j: jjjjwvvjcjjjkj
2-7 x: xkxwxxncxtxvxxlxr
4-13 m: zrxmqfmmjgcgqwk
2-4 b: bqbbbb
2-3 j: gjjlv
14-17 n: nnnqnnntnnnnndnnmnnn
3-8 c: tlcmcccx
2-7 c: ccmlbscmb
7-8 l: ljflbgll
2-11 p: dqkzvmptdgchclbw
7-12 w: wwwwwwwwwwww
1-10 r: htpmgskvrzr
1-4 m: fndmmmmztmcgmx
3-4 t: qmtttzqtt
11-17 g: zggggdgdglqfsgqxggg
2-10 c: ccccfkvxcc
13-15 g: ggggggggggggnggzgg
4-14 z: zzzzzzzzzlzzzzzzzz
4-13 g: ggglggggggggqg
12-13 x: xzxxxxxxxxxkxx
3-7 s: sssssssjss
9-11 j: jjtjrjzjjhjjkbjjjbjt
4-6 r: rkrfrrrrr
5-6 q: qmqcgqqq
4-17 t: tttmtttcttttttttttt
2-4 d: fsbdddpdd
11-15 b: xbbbbbbbbbbbrbqpbb
4-6 s: lkqsqwkszzsjst
13-14 l: lllllllllllllllllll
12-15 t: btlttmbthtttttdtt
9-12 q: mkcqrnfqxqnqskpq
3-5 m: stmmmgqjfv
5-11 v: vvlgzvvvvvv
2-6 n: znntrnhnntbpjkgnqv
7-8 d: sgmddfddjrtv
6-10 k: kqkkbnkkpdk
5-7 n: nnnznnngnl
9-16 q: qqqqqqqqjqqqqqqbqqqq
2-4 w: bwww
9-11 c: jfpvdqftgqx
5-11 c: ccccckcccfccccc
1-2 c: ccbsvl
1-5 d: ddmmd
2-8 j: ntjhkjjmjcj
5-6 p: ppppskpkpp
4-8 t: ztptgptzmtttw
5-6 k: gvjzkmdkfmxnlq
17-18 f: ffffffffffffffffdf
1-13 s: sssbhztsnssgs
3-6 v: mlvvvfvwxvvxv
6-11 p: npkcbslzpvtkjp
2-4 m: gbsjxmjxcdsdnv
16-17 b: bcbbbbbbbbbfbbbbvbbb
17-18 h: lmshsjxbbhhrqhfqchkh
1-3 l: llllk
5-8 h: dhhwhhhnhh
9-12 f: ffdhpzffkffpfcffjf
1-5 k: khbfkkc
1-8 p: ndkpxvpgpppp
1-7 t: tljjkttqptttvt
16-17 t: tttttttttrttttttt
13-18 z: ztzzzzgzzzzglzzndjzf
13-15 q: qqqqqqqqqqqqqqqqq
6-8 v: vvvvvvvv
10-15 q: fqcxlxvhvgfzxwvqv
4-12 g: btdgdglbprjg
3-5 t: gttjt
1-11 w: twwwwwwwwwnwww
2-3 f: jgbfcfbfftccffff
1-2 r: rrrnwr
11-16 r: rrrrrrrrrrrrrrrr
1-16 q: qqqqqqqqqqqqqqqqqqqq
7-16 z: zwzzzzfzzzzzzzzz
10-11 f: fflfmfrjfhjffff
1-5 t: npxgd
7-8 n: nknnnngbxd
4-6 k: kkkkkkk
5-19 d: xtdddjxfvxgddddndndq
8-12 s: vstssxssssss
3-6 f: tlfftfxqhbltbrg
17-19 d: ddddddddddddddddtdc
2-9 q: qqqqnqgbq
8-14 k: wknbkkkbkzkgkdkk
17-18 n: nnnntnnvnnnnnnnnnnnn
15-16 p: ppppppppppppppppp
2-4 h: hwhhhh
4-9 d: ddddddddddd
1-8 s: sssssssrs
14-15 z: zfzzzzzzzcfzzzz
5-6 k: kkkkkkk
5-6 x: xxxxxvx
18-19 r: rrrrjrkbttrjpfjqftm
11-12 f: fffffffffsff
11-17 z: hwzdfvbpbxzfpjwmzq
1-11 m: mxkmnxfbtnmvmtzdqjl
3-4 d: ddjg
17-18 b: jnlntbblbbqbkqmbbb'''

count = 0

for line in data.split('\n'):
    splitArr = line.split(': ')
    splitArr1 = splitArr[0].split(' ')
    splitArr2 = splitArr1[0].split('-')
    password = splitArr[1]
    character = splitArr1[1]
    minVal = splitArr2[0]
    maxVal = splitArr2[1]
    characterOccurance = password.count(character)

    if (characterOccurance >= int(minVal) and characterOccurance <= int(maxVal)):
        count += 1

print(count)
