#CCBCHBA0000008. Số phần tử chia hết cho k (Count Multiples in a Stream)

Số phần tử chia hết cho k (Count Multiples in a Stream)

Count Multiples in a Stream

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given n (possibly negative or zero) integers and positive integer k, count how many are divisible by k. Process values as they are read without storing an array.

Input

Integers n and k, followed by exactly n integers.

Output

One integer: the number of values satisfying x % k == 0.

Subtasks

  • Subtask 1 (20%): 1≤n≤51\le n\le5, 1≤k≤51\le k\le5, ∣x∣≤10|x|\le10.
  • Subtask 2 (30%): 1≤n≤1001\le n\le100, 1≤k≤10001\le k\le1000, ∣x∣≤1000|x|\le1000.
  • Subtask 3 (50%): 1≤n≤100001\le n\le10000, 1≤k≤1061\le k\le10^6, ∣x∣≤106|x|\le10^6.

Examples

Example 1

Input

5 3
3 6 -9 2 0

Output

4

Explanation

3, 6, -9 and 0 are divisible by 3; 2 is not.

Example 2

Input

1 1
-7

Output

1

Explanation

Every integer is divisible by 1.