Remainders

Time limit1sMemory limit128 MB

Summary
Read ten nonnegative integers, compute each mod 42, and print how many distinct remainder values occur.
Level

Easy1 of 10

Topics
Hash map, Implementation
Solved
No attempts yet

Problem

For an integer A and a positive integer B, A % B is the remainder after dividing A by B. For example, the remainders of 7, 14, 27, and 38 divided by 3 are 1, 2, 0, and 2.

Given ten numbers, compute each number's remainder after division by 42. Then determine how many distinct remainder values appear.

Input

Ten lines are given. Each line contains one integer. Every integer is nonnegative and at most 1,000.

Output

Print the number of distinct remainders that appear when the ten input numbers are divided by 42.

Examples3

  1. Example 1

    Input
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    Expected output
    10
    
  2. Example 2

    Input
    42
    84
    252
    420
    840
    126
    42
    84
    420
    126
    
    Expected output
    1
    
  3. Example 3

    Input
    39
    40
    41
    42
    43
    44
    82
    83
    84
    85
    
    Expected output
    6