P13049 [HackerEarth] shil and hiking
普及
题目描述

Shil decided to go for hill climbing on this weekend, but he doesn't have the map of all the hills. However, he's smart enough to make his own map.

There are N hills arranged on a line, each in the form of a vertical line segment with one endpoint on the ground. The hills are numbered with numbers from 1 to N from left to right. The i^th hill stands at the position xi with its top at height yi.

A pair (a, b) ( where a < b ) is called beautiful if and only if Shil will be able to see the peak of b^th hill standing on the top of a^th hill.

In order to make his own map, Shil needs total number of beautiful pairs. As Shil is not a very good programmer, he asks for your help.

Assume that Shil's height is very small as compared to the height of hills. (Really!) Thus, we can assume that Shil's eyes are exactly at the height of peak if he is standing at peak of some hill.

You can also assume that Shil is able to see peak of certain hills if distance between peak and Shil's sight is less than 10^-4.

Input format:
The first line of the input contains a single integer N , the number of hills. The next N lines describe the hills. The i^th of them contains two space-separated integers xi, yi , the position and the height of the i^th hill. The hills are given in the ascending order of xi, i.e., xi < xj for i < j.

Output format:
Print the total number of beautiful pairs.

Constraints:
2 ≤ N ≤ 1000
1 ≤ xi , yi ≤ 10^9

SAMPLE INPUT
4
1 9
2 3
3 7
4 1SAMPLE OUTPUT
4

Explanation

All the beautiful pairs are (1,2),(1,3),(2,3),(3,4)

输入格式

见题面

输出格式

见题面

样例输入
500 2 99998 3 99997 4 99996 5 99995 6 99994 7 99993 8 99992 9 99991 10 99990 11 99989 12 99988 13 99987 14 99986 15 99985 16 99984 17 99983 18 99982 19 99981 20 99980 21 99979 22 99978 23 99977 24 99976 25 99975 26 99974 27 99973 28 99972 29 99971 30 99970 31 99969 32 99968 33 99967 34 99966 35 99965 36 99964 37 99963 38 99962 39 99961 40 99960 41 99959 42 99958 43 99957 44 99956 45 99955 46 99954 47 99953 48 99952 49 99951 50 99950 51 99949 52 99948 53 99947 54 99946 55 99945 56 99944 57 99943 58 99942 59 99941 60 99940 61 99939 62 99938 63 99937 64 99936 65 99935 66 99934 67 99933 68 99932 69 99931 70 99930 71 99929 72 99928 73 99927 74 99926 75 99925 76 99924 77 99923 78 99922 79 99921 80 99920 81 99919 82 99918 83 99917 84 99916 85 99915 86 99914 87 99913 88 99912 89 99911 90 99910 91 99909 92 99908 93 99907 94 99906 95 99905 96 99904 97 99903 98 99902 99 99901 100 99900 101 99899 102 99898 103 99897 104 99896 105 99895 106 99894 107 99893 108 99892 109 99891 110 99890 111 99889 112 99888 113 99887 114 99886 115 99885 116 99884 117 99883 118 99882 119 99881 120 99880 121 99879 122 99878 123 99877 124 99876 125 99875 126 99874 127 99873 128 99872 129 99871 130 99870 131 99869 132 99868 133 99867 134 99866 135 99865 136 99864 137 99863 138 99862 139 99861 140 99860 141 99859 142 99858 143 99857 144 99856 145 99855 146 99854 147 99853 148 99852 149 99851 150 99850 151 99849 152 99848 153 99847 154 99846 155 99845 156 99844 157 99843 158 99842 159 99841 160 99840 161 99839 162 99838 163 99837 164 99836 165 99835 166 99834 167 99833 168 99832 169 99831 170 99830 171 99829 172 99828 173 99827 174 99826 175 99825 176 99824 177 99823 178 99822 179 99821 180 99820 181 99819 182 99818 183 99817 184 99816 185 99815 186 99814 187 99813 188 99812 189 99811 190 99810 191 99809 192 99808 193 99807 194 99806 195 99805 196 99804 197 99803 198 99802 199 99801 200 99800 201 99799 202 99798 203 99797 204 99796 205 99795 206 99794 207 99793 208 99792 209 99791 210 99790 211 99789 212 99788 213 99787 214 99786 215 99785 216 99784 217 99783 218 99782 219 99781 220 99780 221 99779 222 99778 223 99777 224 99776 225 99775 226 99774 227 99773 228 99772 229 99771 230 99770 231 99769 232 99768 233 99767 234 99766 235 99765 236 99764 237 99763 238 99762 239 99761 240 99760 241 99759 242 99758 243 99757 244 99756 245 99755 246 99754 247 99753 248 99752 249 99751 250 99750 251 99749 252 499748 253 499747 254 499746 255 499745 256 499744 257 499743 258 499742 259 499741 260 499740 261 499739 262 499738 263 499737 264 499736 265 499735 266 499734 267 499733 268 499732 269 499731 270 499730 271 499729 272 499728 273 499727 274 499726 275 499725 276 499724 277 499723 278 499722 279 499721 280 499720 281 499719 282 499718 283 499717 284 499716 285 499715 286 499714 287 499713 288 499712 289 499711 290 499710 291 499709 292 499708 293 499707 294 499706 295 499705 296 499704 297 499703 298 499702 299 499701 300 499700 301 499699 302 499698 303 499697 304 499696 305 499695 306 499694 307 499693 308 499692 309 499691 310 499690 311 499689 312 499688 313 499687 314 499686 315 499685 316 499684 317 499683 318 499682 319 499681 320 499680 321 499679 322 499678 323 499677 324 499676 325 499675 326 499674 327 499673 328 499672 329 499671 330 499670 331 499669 332 499668 333 499667 334 499666 335 499665 336 499664 337 499663 338 499662 339 499661 340 499660 341 499659 342 499658 343 499657 344 499656 345 499655 346 499654 347 499653 348 499652 349 499651 350 499650 351 499649 352 499648 353 499647 354 499646 355 499645 356 499644 357 499643 358 499642 359 499641 360 499640 361 499639 362 499638 363 499637 364 499636 365 499635 366 499634 367 499633 368 499632 369 499631 370 499630 371 499629 372 499628 373 499627 374 499626 375 499625 376 499624 377 499623 378 499622 379 499621 380 499620 381 499619 382 499618 383 499617 384 499616 385 499615 386 499614 387 499613 388 499612 389 499611 390 499610 391 499609 392 499608 393 499607 394 499606 395 499605 396 499604 397 499603 398 499602 399 499601 400 499600 401 499599 402 499598 403 499597 404 499596 405 499595 406 499594 407 499593 408 499592 409 499591 410 499590 411 499589 412 499588 413 499587 414 499586 415 499585 416 499584 417 499583 418 499582 419 499581 420 499580 421 499579 422 499578 423 499577 424 499576 425 499575 426 499574 427 499573 428 499572 429 499571 430 499570 431 499569 432 499568 433 499567 434 499566 435 499565 436 499564 437 499563 438 499562 439 499561 440 499560 441 499559 442 499558 443 499557 444 499556 445 499555 446 499554 447 499553 448 499552 449 499551 450 499550 451 499549 452 499548 453 499547 454 499546 455 499545 456 499544 457 499543 458 499542 459 499541 460 499540 461 499539 462 499538 463 499537 464 499536 465 499535 466 499534 467 499533 468 499532 469 499531 470 499530 471 499529 472 499528 473 499527 474 499526 475 499525 476 499524 477 499523 478 499522 479 499521 480 499520 481 499519 482 499518 483 499517 484 499516 485 499515 486 499514 487 499513 488 499512 489 499511 490 499510 491 499509 492 499508 493 499507 494 499506 495 499505 496 499504 497 499503 498 499502 499 499501 500 499500 501 499499
样例输出
62500