using System;
using System.Text;
using System.Collections.Generic;

namespace AOJ2
{
    class Program
    {
        class Point
        {
            public decimal X;
            public decimal Y;

            public Point(decimal x, decimal y)
            {
                X = x;
                Y = y;
            }

        }

        static void Main(string[] args)
        {
            List<decimal> resultList = new List<decimal>();
            int num = int.Parse(Console.ReadLine());

            List<Point> sealList = new List<Point>();
            while (true)
            {
                string input = Console.ReadLine();
                if (input == "0")
                {
                    break;
                }

                string[] inputArray = input.Split(',');
                Point point = new Point(decimal.Parse(inputArray[0]), decimal.Parse(inputArray[1]));
                sealList.Add(point);
            }

            int max = 0;
            int[] countArray = new int[num];

            for (int i = 0; i < num; i++)
            {
                for (int j = i + 1; j < num; j++)
                {
                    if (Judge(sealList[i], sealList[j]))
                    {
                        countArray[i]++;
                        countArray[j]++;
                        if (countArray[i] > max)
                        {
                            max = countArray[i];
                        }
                        if (countArray[j] > max)
                        {
                            max = countArray[j];
                        }
                    }
                }
            }

            Console.WriteLine(max+1);


        }

        static bool Judge(Point A, Point B)
        {
            if (Math.Sqrt(Math.Pow((double)(A.X - B.X), 2) + Math.Pow((double)(A.Y - B.Y), 2)) <= 2)
            {
                return true;
            }
            else
            {
                return false;
            }


        }
        
    }
}