Flagging High-Risk Transactions
Halcyon Bank's card system marks a payment as high-risk when the amount is over $500. The rule is strict about the boundary: a payment of exactly $500 is not marked. The overnight report opens with a single figure — how many of the day's payments got marked — and the amounts reach it as one long list, in the order the payments cleared, with nothing marked in advance.
Task: Print how many payments are high-risk.
Input
The first line holds a single integer n, the number of payments. Each of the next n lines holds one amount in dollars, which may carry decimals. There is always at least one payment.
Output
One line holding the number of marked payments, as a whole number. If none were marked, print 0.
Example:
Input:
4
120
600
45
900
Output:
2
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in