object Main {
  def readLine: String = scala.io.StdIn.readLine()
  def readLines(n: Int): Seq[String] = List.fill(n)(readLine)

  def yesNo(b: Boolean): String = if (b) "Yes" else "No"

  def main(args: Array[String]): Unit = {
    case class Xy(string: String) {
      import scala.math.{pow, sqrt}
      val Array(x: Double, y: Double) = string.split(',').map(_.toDouble)
      def overLap(xy: Xy): Boolean = sqrt(pow(xy.x - x, 2) + pow(xy.y - y, 2)) < 2
    }
    val n: Int = readLine.toInt
    val xys: Seq[Xy] = readLines(n).map(Xy)
    println(xys.map(a => xys.count(a.overLap)).max)
  }
}