Under construction

Still being built. Things may change

Record Keeping

Interview

Time limit1sMemory limit128 MB

Summary
Count how many times the most repeated unordered group of three cow names appears in N lines.
Level

Easy3 of 10

Topics
Hash map, Sorting
Solved
No attempts yet

Problem

Farmer John writes down a record of his cows as they walk into the barn to be milked. Each hour one group of three cows walks in, and Farmer John writes the three names on a single line.

The same group can come back in later hours. Farmer John does not always write the names in the same order, so two lines describe the same group when they list the same three names in any order.

Given the record of NN hours, count how many times the most frequent group walked into the barn.

Input

The first line contains the number of hours NN (1≤N≤10001 \le N \le 1000) that Farmer John recorded.

Each of the next NN lines contains three cow names separated by single spaces. A name uses only the uppercase letters A to Z and is 1 to 10 characters long.

Output

Print the number of times the most frequent group walked into the barn.

Hint

The order of the three names on a line does not change which group the line describes. BESSIE ELSIE MATILDA and MATILDA BESSIE ELSIE are the same group.

Examples1

  1. Example 1

    Input
    5
    BESSIE ELSIE MATILDA
    FRAN BESSIE INGRID
    BESSIE ELSIE MATILDA
    MATILDA INGRID FRAN
    ELSIE BESSIE MATILDA
    
    Expected output
    3