public int ReadVertices ()
{


  int  n = 0;
  String s;
  char c;
  char line[] = new char[20];
  int i = 0;
  int x, y, z;
  boolean flag;
  int counter;

  try{

   //*************
 System.out.println("\n\nInput points:\nCoord-s must be seperated by a *tab*\n"+
		       "ENTER after each point"+"\nTo finish input type end + "+
		       "ENTER at the end"+
		       "\nExample:\n17      23      123\n34      5      1\nend\n"+
		       "-----------------start entering data-------------------");
    do {
      do {
	c = (char) System.in.read();
	line[i] = c;
	i++;
      } while (c !='\n' );
      s = new String(line);
      s = s.substring(0,i-1);
      if (s.equals("end"))
	break;
      flag = false;
      counter = 0;
      for (int j=0; j < s.length(); j++) {
	if (s.charAt(j) == '\t') 
	  counter++; 
	if (counter == 2) {
	  flag = true; break; 
	}
      }
      if (flag) {
	int t = s.indexOf('\t');
	int t1 = s.lastIndexOf('\t');
	x = Integer.parseInt(s.substring(0,t));
	y = Integer.parseInt(s.substring(t+1,t1));
	z = Integer.parseInt(s.substring(t1+1,s.length()));
	Vertices[n] = new tPointi(x,y,z);
	n++;
	i=0;
      }
      else 
	break;
    } while (!s.equals("end"));
  }
  catch (IOException e){System.out.println("Invalid input");System.exit(1);};
   //*************
   return n;
}