#CCBCHBAHAI0000173. Ghép đôi tất (Sales by Match)

    ID: 1091 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesInteger arithmetic

Ghép đôi tất (Sales by Match)

Sales by Match

Source: HackerRank

Version: Phuoc Hung OJ Extended

Problem

There are nn socks. Sock ii has color ID aia_i. Two socks form a pair if and only if their colors are equal, and each sock can be used in at most one pair.

If color vv occurs fvf_v times, it contributes

⌊fv2⌋\left\lfloor\frac{f_v}{2}\right\rfloor

pairs. Compute the total number of pairs.

Input

  • The first line contains nn.
  • The second line contains a1,a2,…,ana_1,a_2,\ldots,a_n.

Output

Print the total number of pairs.

Subtasks

Subtask 1 (20 points): 1≤n≤201\le n\le 20 and 1≤ai≤201\le a_i\le 20.

Subtask 2 (30 points): 1≤n≤501\le n\le 50 and 1≤ai≤501\le a_i\le 50.

Subtask 3 (50 points): 1≤n≤1001\le n\le 100 and 1≤ai≤1001\le a_i\le 100.

Example

Input

9
10 20 20 10 10 30 50 10 20

Output

3

Explanation

Color 10 makes two pairs and color 20 makes one pair, for a total of three.