import scala.math.{pow, sqrt}

object Main {
  lazy val lines: Seq[String] = {
    def readToEnd(ss: List[String] = Nil): List[String] = io.StdIn.readLine() match {
      case "" => ss
      case null => ss
      case s => readToEnd(ss :+ s)
    }
    readToEnd()
  }

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

  def main(args: Array[String]): Unit = {
    case class Xy(string: String) {
      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 xys: Seq[Xy] = lines.tail.init.map(Xy)
    println(xys.map(a => xys.count(a.overLap)).max)
  }
}