#include <iostream>
#include <string>
#include <map>
#include <algorithm>

int main() {
    int n;
    std::cin >> n;

    std::string names[20];

    std::map<std::string, int> freq;

    for (int i = 0; i < n; ++i) {
        std::string names[5];
        for (int j = 0; j < 3; ++j)
            std::cin >> names[j];
        
        std::sort(names, names + 3);

        std::string result = names[0] + ";" + names[1] + ";" + names[2];
        ++freq[result];
    }

    int ans = 0;
    for (auto it : freq) {
        if (it.second > ans)
            ans = it.second;
    }

    std::cout << ans;
}