// Solution to "Phone Home" by Bob Roos
// Just unadorned, unintelligent backtracking. I was working on a
// more efficient one, but time's running out!

import java.util.*;
import java.io.*;

// Use an adjacency list rep. for the graph:
class Node {
  public int value;
  public Node next;
  public Node(int v, Node n) {
    value = v;
    next = n;
  }
}


public class Phone {
  public static int n;           // # nodes
  public static double x[], y[]; // node locations
  public static Node adj[];      // adj[i] points to list of neighbors
  public static int lastused;    // largest color number used
  public static int color[];     // color[i] = color of node i

  public static void main(String[] args) throws IOException {
    BufferedReader in =
      new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    String line;
    int casenum = 0;
  
    while ((line = in.readLine()) != null) {
     // Get number of nodes:
      n = Integer.parseInt(line.trim());
      if (n == 0) break;

      casenum++;
     // Get node locations:
      x = new double[n];
      y = new double[n];
      line = in.readLine();
      st = new StringTokenizer(line);
      for (int i = 0; i < n; i++) {
        x[i] = Double.parseDouble(st.nextToken());
        y[i] = Double.parseDouble(st.nextToken());
      }

     // Figure out which nodes are neighbors:
      adj = new Node[n];
      for (int i = 0; i < n; i++) {
        adj[i] = new Node(-1,null);
        for (int j = 0; j < n; j++) {
          if (j != i && near(i,j)) {
            Node temp = new Node(j,adj[i]);
            adj[i] = temp;
          }
        }
      }
// DEBUG:      display();
      System.out.println("The towers in case " + casenum + " can be covered in " 
         + solve() + " frequencies.");
    }
  }

/***************** FOR DEBUGGING PURPOSES ONLY: ************
  public static void display() {
    for (int i = 0; i < n; i++) {
      System.out.print("Tower " + i + ": ");
      for (Node temp = adj[i]; temp.value != -1; temp = temp.next) {
        System.out.print(temp.value + " ");
      }
      System.out.println();
    }
  }
************************************************************/


 // See if two towers are adjacent in the graph -- within distance 20
  public static boolean near(int i, int j) {
    double sumsq = (x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]); 
    return sumsq <= 400;
  }


  // Do a DFS of the graph. Each connected component is minimally
  // colored by procedure "dfscolor". Returns false if graph can't
  // be colored using the current max. number of colors.
  public static int solve() {
    color = new int[n]; // color[i] = color of node i
    for (int i = 0; i < n; i++) { // initially, no nodes colored
      color[i] = 0;
    }

    color[0] = 1; // color first node with first color
    lastused = 1; // last "new" color that was used

    // Graph may be disconnected, so do a dfs from each node.
    // Each component can be solved independently.
    for (int i = 1; i < n; i++) {
      if (color[i] <= 0) // new connected component starts here
        while (!dfscolor(i)) // keep bumping up number of colors until
           lastused++;       // it works
    }
    return lastused;
  }


  // Color nodes in depth-first fashiion.
  // pre: v has no color yet
  public static boolean dfscolor(int v) {
    boolean success = false;

    int col = 1; // try each color from 1 up to lastused for node v:
    while(col <= lastused) {
      color[v] = col;
      success = true;
     // Now recursively color all uncolored neighbors if possible
      for (Node nbr = adj[v]; nbr.value != -1; nbr = nbr.next) {
        if (color[nbr.value] <= 0) {
          success = success && dfscolor(nbr.value);
          if (!success)
            break;
        }
        else if (color[nbr.value] == col) {
          success = false;
          break;
        }
       // Else neighbor is already compatibly colored
      }

      if (success) {
// DEBUG: System.out.println("Coloring node " + v + ": " + col);
         color[v] = 0;
         return true;
      }
      else { // undo coloring of v and move on to next color
        color[v] = 0;
        col++;
      }
    }
    return false; // couldn't do it in the given number of colors
  }
}
