#include <bits/stdc++.h>
int findMax(const std::map<std::string, int>& rowMap) {
  int ret = 0;
  for (std::map<std::string, int>::const_iterator it = rowMap.begin();
       it != rowMap.end(); ++it) {
    if (it->second > ret) ret = it->second;
  }
  return ret;
}
int main() {
  std::map<std::string, int> rowMap;
  int numberOfLine(0);
  std::cin >> numberOfLine;
  for (int i = 0; i < numberOfLine; ++i) {
    std::string line;
    std::cin >> line;
    if (rowMap.find(line) == rowMap.end()) {
      rowMap[line] = 1;
    } else {
      rowMap[line]++;
    }
  }
  std::cout << findMax(rowMap) << std::endl;
  return 0;
}
