PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#CCBCHHAI0000010. Đếm lần nhập sai trước khi đạt chuẩn (Count Invalid Scores Before Acceptance)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm lần nhập sai trước khi đạt chuẩn (Count Invalid Scores Before Acceptance)

Count Invalid Scores Before Acceptance

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Read real-valued scores until the first value within the inclusive interval [0,10]. Count only preceding invalid scores; do not count the successful read.

Input

A sequence of scores, each written with at most two decimal places. The last score is in [0,10] and all prior scores are outside it.

Output

Print the number of invalid scores before the first accepted score.

Subtasks

  • Subtask 1 (20%): At most 5 scores, each within [−100,100][-100,100].
  • Subtask 2 (30%): At most 100 scores, each within [−1000,1000][-1000,1000].
  • Subtask 3 (50%): At most 100001100001 scores, each within [−106,106][-10^6,10^6].

Examples

Example 1

Input

-1 10.01 10

Output

2

Explanation

-1 and 10.01 are invalid. The last value 10 is accepted, so the answer is 2.

Example 2

Input

0

Output

0

Explanation

Zero is valid on the first read; the count is zero.