memo = Hash.new DATA.each do |row| _, a, cnt = row.chomp.split memo[a.to_i] = cnt.to_i end A = gets.to_i puts memo[A] __END__ A 1 499853409 A 2 198066141 A 3 65944976 A 4 0 A 5 0 A 6 83359314 A 7 197704749 A 8 499956396 A 9 461596998 A 10 499924557 A 11 250031589 A 12 66025737 A 13 0 A 14 0 A 15 65922195 A 16 197880351 A 17 395804754 A 18 461671050 A 19 395752629 A 20 197825844 A 21 65951319 A 22 0 A 23 0 A 24 65936360 A 25 197777304 A 26 499639056 A 27 583029498 A 28 395715012 A 29 249552855 A 30 66073349 A 31 0 A 32 0 A 33 66026043 A 34 197876565 A 35 395514645 A 36 582863367 A 37 303214194 A 38 249900573 A 39 66080034 A 40 0 A 41 0 A 42 65941840 A 43 249952551 A 44 395548158 A 45 583092006 A 46 395796816 A 47 250096923 A 48 83408904 A 49 0 A 50 0 A 51 83352606 A 52 197785611 A 53 395734917 A 54 461688090 A 55 395834907 A 56 197910177 A 57 65958885 A 58 0 A 59 0 A 60 83129445 A 61 197879421 A 62 395601315 A 63 583179990 A 64 499975596 A 65 197894460 A 66 83217288 A 67 0 A 68 0 A 69 65851552 A 70 197977152 A 71 395723337 A 72 461598072 A 73 499492386 A 74 151682058 A 75 83391159 A 76 0 A 77 0 A 78 65982393 A 79 197810568 A 80 499698792 A 81 461615477 A 82 499465320 A 83 197929308 A 84 83479962 A 85 0 A 86 0 A 87 66034772 A 88 249868407 A 89 395609340 A 90 461586120 A 91 395850384 A 92 197943681 A 93 65989561 A 94 0 A 95 0 A 96 66018201 A 97 249605913 A 98 395763186 A 99 461545017 A 100 500244135 A 101 250121904 A 102 65992770 A 103 0 A 104 0 A 105 83439696 A 106 197582427 A 107 395906010 A 108 461534357 A 109 395972283 A 110 249747105 A 111 50667829 A 112 0 A 113 0 A 114 65970890 A 115 197840178 A 116 395783145 A 117 582714366 A 118 395839320 A 119 249607272 A 120 66034569 A 121 0 A 122 0 A 123 65970813 A 124 197862537 A 125 499837770 A 126 461586033 A 127 395704725 A 128 197937468 A 129 66025153 A 130 0 A 131 0 A 132 65971953 A 133 197855130 A 134 499324197 A 135 461779937 A 136 395694588 A 137 250272546 A 138 83394459 A 139 0 A 140 0 A 141 65931391 A 142 250137234 A 143 395347209 A 144 461799958 A 145 395664129 A 146 198104688 A 147 83187177 A 148 0 A 149 0 A 150 65844093 A 151 197915487 A 152 395640954 A 153 461877100 A 154 499267476 A 155 197996145 A 156 83116794 A 157 0 A 158 0 A 159 83077128 A 160 197816517 A 161 395716419 A 162 583089981 A 163 395680647 A 164 197847309 A 165 66034770 A 166 0 A 167 0 A 168 65927544 A 169 197856531 A 170 395729877 A 171 582755274 A 172 395784210 A 173 197870754 A 174 83518725 A 175 0 A 176 0 A 177 83482623 A 178 197741811 A 179 500063223 A 180 461407793 A 181 395845749 A 182 197818044 A 183 66124482 A 184 0 A 185 0 A 186 83419152 A 187 197585898 A 188 395806743 A 189 461487779 A 190 396117981 A 191 249519294 A 192 66035306 A 193 0 A 194 0 A 195 83193621 A 196 249380424 A 197 395683833 A 198 461503212 A 199 500027589 A 200 197855943 A 201 65988450 A 202 0 A 203 0 A 204 65930507 A 205 197764092 A 206 395690775 A 207 461566449 A 208 499518105 A 209 197901777 A 210 65986020 A 211 0 A 212 0 A 213 65933772 A 214 250096410 A 215 395624835 A 216 583102701 A 217 395703927 A 218 197915679 A 219 65987298 A 220 0 A 221 0 A 222 50523021 A 223 249970845 A 224 395405595 A 225 461756184 A 226 395565168 A 227 198146163 A 228 83144547 A 229 0 A 230 0 A 231 65983467 A 232 249543381 A 233 499087524 A 234 461617473 A 235 395695518 A 236 250057275 A 237 65957211 A 238 0 A 239 0 A 240 65974043 A 241 197782437 A 242 395546595 A 243 461593956 A 244 395765376 A 245 249800436 A 246 65946828 A 247 0 A 248 0 A 249 83100603 A 250 197759865 A 251 499933236 A 252 461658190 A 253 499637970 A 254 197937693 A 255 65994989 A 256 0 A 257 0 A 258 83165199 A 259 151389405 A 260 499921449 A 261 461545845 A 262 395752965 A 263 197762508 A 264 66111248 A 265 0 A 266 0 A 267 83355123 A 268 197818980 A 269 499370913 A 270 582628467 A 271 395794911 A 272 197844207 A 273 83457036 A 274 0 A 275 0 A 276 66017907 A 277 197835168 A 278 395622237 A 279 461486226 A 280 395661093 A 281 197892921 A 282 83237010 A 283 0 A 284 0 A 285 83211351 A 286 249550986 A 287 395580453 A 288 582788094 A 289 395923029 A 290 249712644 A 291 66025575 A 292 0 A 293 0 A 294 65897514 A 295 249726033 A 296 302922846 A 297 583014219 A 298 395884293 A 299 197863206 A 300 65933645 A 301 0 A 302 0 A 303 65893369 A 304 250099782 A 305 395686374 A 306 582793884 A 307 499733808 A 308 197928006 A 309 66021523 A 310 0 A 311 0 A 312 66010887 A 313 197890128 A 314 395726169 A 315 461611814 A 316 395609376 A 317 197826183 A 318 66037128 A 319 0 A 320 0 A 321 65941779 A 322 249662991 A 323 499401411 A 324 461547663 A 325 499391031 A 326 198039087 A 327 83234613 A 328 0 A 329 0 A 330 66018343 A 331 197644773 A 332 499469412 A 333 353412483