Problem: Hit n nails one by one at the coordinates P1 (x1, y1), P2 (x2, y2), P3 (x3, y3), ..., Pn (xn, yn) on the flat plate, and put them on the rubber band ring. Surround it with a single rubber band so that all the nails fit inside. At this time, the rubber bands must not intersect.

Create a program that reads the coordinates of the nails and outputs the number of nails that are not in contact with the rubber band when the nail is surrounded by the rubber band as described above. The rubber band shall expand and contract sufficiently. You may not hit more than one nail at the same coordinates. In addition, it is assumed that the nails covered with rubber bands are connected by a straight line, and that no more than three nails are lined up on the straight line. For example, there can be no input as shown in Figure 1. As shown in Figure 2, it is possible for nails without rubber bands to line up in a straight line.

<image> | <image>
--- | ---
Figure 1 | Figure 2



However, each coordinate value is a real number between -1000.0 and 1000.0. Also, n is an integer between 3 and 100.

Hint

Below is a diagram for the second sample input.

<image>
---



Input

Given multiple datasets. Each dataset is given in the following format:


n
x1, y1
x2, y2
...
...
xn, yn


When n is 0, it indicates the end of input. The number of datasets does not exceed 50.

Output

For each dataset, output the number of nails that are not in contact with the rubber. For example, if there is an input representing the four nails shown in Fig. 3, it will be surrounded as shown in Fig. 4, so the number of nails that are not in contact with the rubber band is one.

<image> | <image>
--- | ---
Figure 3 | Figure 4


Example

Input

4
1.0,0.0
0.0,1.0
2.0,1.0
1.0,2.0
9
-509.94,892.63
567.62,639.99
-859.32,-64.84
-445.99,383.69
667.54,430.49
551.12,828.21
-940.2,-877.2
-361.62,-970
-125.42,-178.48
0


Output

0
3

Solution (in JAVA):

Solution:
public class Main{
  static int infi = 10001;
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int n, i, j, m, l, r;
    char[] c;
    String s;
    double[] x, y;

    for(;;){
      n = sc.nextInt();
      if(n == 0)break;
      x = new double[n]; y = new double[n];
      for(i = 0;i < n;i++){
        s = sc.next(); c = new char[s.length()];
        for(j = 0;j < s.length();j++)c[j] = s.charAt(j);
        l = 0;
        for(j = 0;j < s.length();j++)if(c[j] == ','){
          r = j; x[i] = readdouble(c, l, r); l = ++r; break;
        }
        y[i] = readdouble(c, l, s.length());
      }

      m = getconvex(x, y, n);
      out.println(n - m);
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
  private static double readdouble(char[] ch, int l, int r){
    int i;
    double res, d, s;
    s = 1;
    if(ch[l] == '-'){
      s = -1; l++;
    }
    d = 1.0; res = 0.0;
    for(i = l;i < r;i++){
      if(ch[i] == '.')break;
      d *= 10;
    }
    d /= 10;
    for(i = l;i < r;i++)if(ch[i] != '.'){
      res += d * (double)(ch[i] - '0');
      d /= 10;
    }
    return res * s;
  }
  private static int getconvex(double[] x, double[] y, int n){
    int i, numr, numl;
    double[] resx, resy, anslx, ansly;
    mergesort(x, y, 0, n);
    resx = new double[n]; resy = new double[n];
    numr = rcovering(x, y, n, resx, resy);
    if(n == numr)return numr;
    else{
      anslx = new double[n]; ansly = new double[n];
      reverse(x, y, n);
      numl = rcovering(x, y, n, anslx, ansly);
      for(i = 0;i < numl;i++){
        resx[numr + i] = anslx[i]; resy[numr + i] = ansly[i];
      }
    }
    return (numr + numl);
  }
  private static int rcovering(double[] x, double[] y, int n,
                                double[] ansx, double[] ansy){
    int i, num;
    ansx[0] = x[0]; ansy[0] = y[0];
    ansx[1] = x[1]; ansy[1] = y[1];
    num = 2;
    for(i = 2;i < n;i++){
      ansx[num] = x[i]; ansy[num] = y[i];
      num = gscan(ansx, ansy, num);
    }
    if(ansx[num - 1] == x[n - 1] && ansy[num - 1] == y[n - 1])num--;
    return num;
  }
  private static void reverse(double[] x, double[] y, int n){
    double tmp;
    int i;
    for(i = 0;i < n / 2;i++){
      tmp = x[i]; x[i] = x[n - 1 - i]; x[n - 1 - i] = tmp;
      tmp = y[i]; y[i] = y[n - 1 - i]; y[n - 1 - i] = tmp;
    }
    return;
  }
  private static int gscan(double[] ansx, double[] ansy, int num){
    double s1x, s1y, s2x, s2y;
    for(;num > 0;){
      if(num == 1)return ++num;
      s1x = ansx[num - 1] - ansx[num]; s1y = ansy[num - 1] - ansy[num];
      s2x = ansx[num - 2] - ansx[num]; s2y = ansy[num - 2] - ansy[num];
      if(s1x * s2y - s2x * s1y > 0){
        ansx[num - 1] = ansx[num]; ansy[num - 1] = ansy[num]; num--;
      }else return ++num;
    }
    return num;
  }
  private static void mergesort(double[] x, double[] y, int l, int r){
    int m, c;
    if(l + 1 >= r)return;
    else{
      m = (l + r) / 2;
      mergesort(x, y, l, m); mergesort(x, y, m, r); merge(x, y, l, m, r);
      return;
    }
  }
  private static void merge(double[] x, double[] y, int l, int m, int r){
    int nl, nr;
    int i, j, k;
    double[] xl, xr, yl, yr;
    nl = m - l; nr = r - m;
    xl = new double[nl + 1]; xr = new double[nr + 1];
    yl = new double[nl + 1]; yr = new double[nr + 1];
    for(i = 0;i < nl;i++){ xl[i] = x[l + i]; yl[i] = y[l + i]; }
    for(i = 0;i < nr;i++){ xr[i] = x[m + i]; yr[i] = y[m + i]; }
    xl[nl] = infi; xr[nr] = infi; yl[nl] = infi; yr[nr] = infi;
    i = 0; j = 0;
    for(k = l;k < r;k++){
      if(alow(xl[i], yl[i], xr[j], yr[j])){ x[k] = xl[i]; y[k] = yl[i++]; }
      else{ x[k] = xr[j]; y[k] = yr[j++]; }
    }
    return;
  }
  private static boolean alow(double ax, double ay, double bx, double by){
    if(ay < by || (ay == by && ax <= bx))return true;
    else return false;
  }
}