// Arup Guha
// 8/24/02, commented 9/17/04 for 9/28/04 UCF Practice
// Problem: Olympics

#include <iostream.h>
#include <fstream.h>
#include <math.h>
int inter(int pts[][2], int r);
double distance(int x1, int y1, int x2, int y2);

void main() {

  ifstream fin("olympics.in");
  int pts[5][2];
  int radius;
  int count = 1;

  // Loop until there is no more data.
  while (fin >> pts[0][0] >> pts[0][1]) {

    // Read in the other four points and radius.
    for (int i=1; i<5; i++)
       fin >> pts[i][0] >> pts[i][1];
    fin >> radius;

    // Calculate the number of intersections and output.
    int numinter = inter(pts, radius);
    cout << "Data set " << count << ": " << numinter << endl;
    count++;
  }
  fin.close();
}

// Determines the number of circle intersections given the centers(pts) and the radius of each.
int inter(int pts[][2], int r) {
   int sum = 0;

   // Loop through each pair of circles
   for (int i=0; i<5; i++) {
      for (int j=i+1; j<5; j++) {

         // Compute the distance between the centers of the two circles.
         double d = distance(pts[i][0], pts[i][1], pts[j][0], pts[j][1]);

         // Special case of one intersection point.
         if (d == 2*r)
            sum++;

         // Two intersection points.
         if (d < 2*r)
            sum += 2;
      }
   }
   return sum;
}

// Returns the distance between the point (x1, x2) and (y1, y2)
double distance(int x1, int y1, int x2, int y2) {

   int dsqr = (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
   double ans = (double)(sqrt(dsqr));
   return ans;
}
