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:


import java.awt.geom.Point2D;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while(true){
			int n = Integer.parseInt(br.readLine());

			if(n == 0){
				break;
			}

			Point2D input[] = new Point2D[n];

			for(int i = 0; i < n; i++){
				String[] tmpArray = br.readLine().split(",");

				double x = Double.parseDouble(tmpArray[0]);
				double y = Double.parseDouble(tmpArray[1]);

				input[i] = new Point2D.Double(x, y);
			}

			Convex convex = new Convex(input);

			System.out.println(n - convex.getSize());
		}
	}

	static void printPointAsInt(Point2D point){
		System.out.println((int)point.getX()+" "+(int)point.getY());
	}

}

class Convex {
	//並び順は一番左から時計回り
	Point2D points[];

	Convex(Point2D[] points){

		//x座標で整列
		Arrays.sort(points, (p1, p2) ->(p1.getX() == p2.getX() ?
				(p1.getY() == p2.getY() ? 0 : (p1.getY() > p2.getY() ? 1 : -1)) :
					(p1.getX() > p2.getX() ? 1 : -1))
				);

		ArrayList<Point2D> upper = new ArrayList<Point2D>();
		ArrayList<Point2D> lower = new ArrayList<Point2D>();

		//この2点が上の凸包にあるとする
		upper.add(points[0]);
		upper.add(points[1]);

		for(int i = 2; i < points.length; i++){
			upper.add(points[i]);

			//最後の3点が左回りなら最後から2番目の点を削除
			while(upper.size() >= 3 && crossProduct(upper.get(upper.size() - 3), upper.get(upper.size() - 2), upper.get(upper.size() - 1)) > 0){
				upper.remove(upper.size() - 2);
			}
		}

		//この2点が下の凸包にあるとする
		lower.add(points[0]);
		lower.add(points[1]);

		for(int i = 2; i < points.length; i++){
			lower.add(points[i]);

			//最後の3点が左回りなら最後から2番目の点を削除
			while(lower.size() >= 3 && crossProduct(lower.get(lower.size() - 3), lower.get(lower.size() - 2), lower.get(lower.size() - 1)) < 0){
				lower.remove(lower.size() - 2);
			}
		}

		this.points = new Point2D[upper.size() + lower.size() - 2];

		//upperとlowerを合成した配列を作る
		for(int i = 0; i < upper.size(); i++){
			this.points[i] = upper.get(i);
		}

		for(int i = 0; i < lower.size() - 2; i++){
			this.points[i + upper.size()] = lower.get(lower.size() - i - 2);
		}

	}

	//正なら左回り、負なら右回り、0なら共線
	private double crossProduct(Point2D p1, Point2D p2, Point2D p3){
		return (p2.getX() - p1.getX())*(p3.getY() - p1.getY()) - (p2.getY() - p1.getY())*(p3.getX() - p1.getX());
	}

	//頂点数を返す
	int getSize(){
		return points.length;
	}

	//一番下（y座標が同じなら左）にある頂点のインデックスを返す
	//AOJ CGL4A用
	int searchBottom(){
		int index = 0;
		double x = points[0].getX();
		double y = points[0].getY();

		for(int i = 1; i < points.length; i++){
			if(points[i].getY() < y || (points[i].getY() == y && points[i].getX() < x)){
				index = i;
				x = points[i].getX();
				y = points[i].getY();
			}
		}

		return index;
	}

}