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

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
def cross(a, b):
	return a.real * b.imag - a.imag * b.real

def convex_hull(p):
	pp = sorted(p, key=lambda x: (x.imag, x.real))
	n = len(pp)
	(ans, j) = ([0] * (n + 1), 0)
	for i in range(n):
		while j > 1 and cross(ans[j - 1] - ans[j - 2], pp[i] - ans[j - 1]) < 0:
			j -= 1
		ans[j] = pp[i]
		j += 1
	k = j
	for i in range(n - 2, -1, -1):
		while j > k and cross(ans[j - 1] - ans[j - 2], pp[i] - ans[j - 1]) < 0:
			j -= 1
		ans[j] = pp[i]
		j += 1
	return ans[0:j - 1]
while 1:
	n = int(input())
	if n == 0:
		break
	p = []
	for i in range(n):
		(x, y) = list(map(float, input().split(',')))
		p.append(complex(x, y))
	print(n - len(convex_hull(p)))


import sys
readline = sys.stdin.readline
write = sys.stdout.write

def cross3(a, b, c):
	return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0])
EPS = -1e-09

def convex_hull(ps):
	qs = []
	n = len(ps)
	for p in ps:
		while len(qs) > 1 and cross3(qs[-1], qs[-2], p) > -EPS:
			qs.pop()
		qs.append(p)
	t = len(qs)
	for i in range(n - 2, -1, -1):
		p = ps[i]
		while len(qs) > t and cross3(qs[-1], qs[-2], p) > -EPS:
			qs.pop()
		qs.append(p)
	return qs

def solve():
	N = int(readline())
	if N == 0:
		return False
	P = [list(map(float, readline().split(','))) for i in range(N)]
	P.sort()
	Q = convex_hull(P)
	write('%d\n' % (N - len(Q) + 1))
	return True
while solve():
	...


import sys
import os
for s in sys.stdin:
	N = int(s)
	if N == 0:
		break
	X = []
	Y = []
	visited = [False] * N
	for i in range(N):
		(x, y) = map(float, input().split(','))
		X.append(x)
		Y.append(y)

	def paint(start_i, is_right, is_up):
		x_start = X[start_i]
		y_start = Y[start_i]
		visited[start_i] = True
		if is_right:
			dir_sign = 1
		else:
			dir_sign = -1
		if is_up and is_right or (not is_up and (not is_right)):
			min_max_sign = 1
		else:
			min_max_sign = -1
		tangent_min_i = None
		tangent_min = None
		for (i, x) in enumerate(X):
			if dir_sign * (x - x_start) > 0:
				y = Y[i]
				tangent = (y - y_start) / (x - x_start)
				if tangent_min is None:
					tangent_min = tangent
					tangent_min_i = i
				elif min_max_sign * (tangent_min - tangent) > 0:
					tangent_min = tangent
					tangent_min_i = i
		if tangent_min_i is not None:
			paint(tangent_min_i, is_right, is_up)
	start_index = Y.index(min(Y))
	visited[start_index] = True
	paint(start_index, is_right=True, is_up=True)
	paint(start_index, is_right=False, is_up=True)
	start_index = Y.index(max(Y))
	visited[start_index] = True
	paint(start_index, is_right=True, is_up=False)
	paint(start_index, is_right=False, is_up=False)
	visit_num = 0
	for is_visit in visited:
		if is_visit:
			visit_num += 1
	print(len(X) - visit_num)


eps = 1e-10

def add(a, b):
	return 0 if abs(a + b) < eps * (abs(a) + abs(b)) else a + b

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, p):
		return Point(add(self.x, p.x), add(self.y, p.y))

	def __sub__(self, p):
		return Point(add(self.x, -p.x), add(self.y, -p.y))

	def __mul__(self, d):
		return Point(self.x * d, self.y * d)

	def dot(self, p):
		return add(self.x * p.x, self.y * p.y)

	def det(self, p):
		return add(self.x * p.y, -self.y * p.x)

	def __str__(self):
		return '({}, {})'.format(self.x, self.y)

def convex_hull(ps):
	ps = [Point(x, y) for (x, y) in sorted([(p.x, p.y) for p in ps])]
	lower_hull = get_bounds(ps)
	ps.reverse()
	upper_hull = get_bounds(ps)
	del upper_hull[-1]
	del lower_hull[-1]
	lower_hull.extend(upper_hull)
	return lower_hull

def get_bounds(ps):
	qs = [ps[0], ps[1]]
	for p in ps[2:]:
		while len(qs) > 1 and (qs[-1] - qs[-2]).det(p - qs[-1]) <= 0:
			del qs[-1]
		qs.append(p)
	return qs
while True:
	n = int(input())
	if n == 0:
		break
	points = []
	for i in range(n):
		(x, y) = map(float, input().split(','))
		points.append(Point(x, y))
	print(len(points) - len(convex_hull(points)))


import math

def vec(a, b):
	return [b[0] - a[0], b[1] - a[1]]

def norm(a):
	return math.sqrt(a[0] ** 2 + a[1] ** 2)

def cross(a, b):
	return a[0] * b[1] - b[0] * a[1]

def gift_wrap(p_a, p_h, a):
	while True:
		p_h.append(a)
		b = p_a[0]
		for i in range(len(p_a)):
			c = p_a[i]
			if b == a:
				b = c
			else:
				ab = vec(a, b)
				ac = vec(a, c)
				v = cross(ab, ac)
				if v > 0 or (v == 0 and norm(ac) > norm(ab)):
					b = c
		a = b
		if a == p_h[0]:
			break
while True:
	n = int(input())
	if n == 0:
		break
	p_all = []
	p_hull = []
	for i in range(n):
		p_all.append(list(map(float, input().split(','))))
	p_all = sorted(p_all)
	gift_wrap(p_all, p_hull, p_all[0])
	print(len(p_all) - len(p_hull))


import sys, math, os
PYDEV = os.environ.get('PYDEV')
if PYDEV == 'True':
	sys.stdin = open('sample-input.txt', 'rt')

def distance(p1, p2):
	return math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)

def is_to_the_left(p1, p2, p3):
	position = (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0] - p1[0])
	return position < 0

def jarvis(points):
	max_y = max([p[1] for p in points])
	pointOnHull = [p for p in points if p[1] == max_y][0]
	convex_hull = [pointOnHull]
	while len(convex_hull) == 1 or convex_hull[-1] != convex_hull[0]:
		p = convex_hull[-1]
		endpoint = points[0]
		for j in range(len(points)):
			if endpoint == pointOnHull or is_to_the_left(p, endpoint, points[j]):
				endpoint = points[j]
		pointOnHull = endpoint
		convex_hull.append(pointOnHull)
	return convex_hull[::-1]
while True:
	N = int(input())
	if N == 0:
		break
	points = [[float(_) for _ in input().split(',')] for __ in range(N)]
	print(N - (len(jarvis(points)) - 1))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def ccw(a, b, c):
	ax = b[0] - a[0]
	ay = b[1] - a[1]
	bx = c[0] - a[0]
	by = c[1] - a[1]
	t = ax * by - ay * bx
	if t > 0:
		return 1
	if t < 0:
		return -1
	if ax * bx + ay * by < 0:
		return 2
	if ax * ax + ay * ay < bx * bx + by * by:
		return -2
	return 0

def convex_hull(ps):
	n = len(ps)
	k = 0
	ps.sort()
	ch = [[-1, -1] for _ in range(n * 2)]
	for i in range(n):
		while k >= 2 and ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0:
			k -= 1
		ch[k] = ps[i]
		k += 1
	t = k + 1
	for i in range(n - 2, -1, -1):
		while k >= t and ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0:
			k -= 1
		ch[k] = ps[i]
		k += 1
	ch = ch[:k - 1]
	return ch

def main():
	rr = []
	while True:
		n = I()
		if n == 0:
			break
		a = [list(map(float, S().split(','))) for _ in range(n)]
		r = convex_hull(a)
		rr.append(n - len(r))
	return '\n'.join(map(str, rr))
print(main())


import enum
EPS = 1e-10

class PointsRelation(enum.Enum):
	counter_clockwise = 1
	clockwise = 2
	online_back = 3
	on_segment = 4
	online_front = 5

def inner_product(v1, v2):
	return v1.real * v2.real + v1.imag * v2.imag

def outer_product(v1, v2):
	return v1.real * v2.imag - v1.imag * v2.real

def project(a, b):
	return a * inner_product(a, b) / abs(a) ** 2

def points_relation(p0, p1, p2):
	v1 = p1 - p0
	v2 = p2 - p0
	op = outer_product(v1, v2)
	if op > EPS:
		return PointsRelation.counter_clockwise
	elif op < -EPS:
		return PointsRelation.clockwise
	elif inner_product(v1, v2) < -EPS:
		return PointsRelation.online_back
	elif abs(v1) < abs(v2):
		return PointsRelation.online_front
	else:
		return PointsRelation.on_segment

def in_place_convex_hull_andrew(ps):

	def judge(p0, p1, p2):
		b = points_relation(p0, p1, p2) != PointsRelation.counter_clockwise
		b &= points_relation(p0, p1, p2) != PointsRelation.online_front
		return b
	if len(ps) < 3:
		return ps
	ps.sort(key=lambda p: p.imag)
	n = len(ps)
	k = 0
	ch = [None for _ in range(2 * n)]
	for i in range(n):
		while k >= 2 and judge(ch[k - 2], ch[k - 1], ps[i]):
			k -= 1
		ch[k] = ps[i]
		k += 1
	t = k + 1
	for i in range(n - 1)[::-1]:
		while k >= t and judge(ch[k - 2], ch[k - 1], ps[i]):
			k -= 1
		ch[k] = ps[i]
		k += 1
	ch = ch[:k - 1]
	return ch

def main():
	while True:
		n = int(input())
		if n == 0:
			return
		ps = [complex(*map(float, input().split(','))) for _ in range(n)]
		ch = in_place_convex_hull_andrew(ps)
		print(n - len(ch))
main()


def quickhull(l, r, s, k):
	if not s:
		return
	su = []
	sd = []
	a = (r[0] - l[0], r[1] - l[1])
	for (x, y) in s:
		b = (x - l[0], y - l[1])
		cro = cross(a, b)
		if cro > 0:
			su.append((x, y))
		elif cro < 0:
			sd.append((x, y))
	if su:
		(c, d) = direction(l, r, su[0])
		p = su[0]
		for i in range(1, len(su)):
			(c_, d_) = direction(l, r, su[i])
			if c * d_ < c_ * d:
				(c, d) = (c_, d_)
				p = su[i]
		k.append(tuple(p))
		b = (l[0] - p[0], l[1] - p[1])
		c = (p[0] - r[0], p[1] - r[1])
		s1 = []
		s2 = []
		for (x, y) in su:
			b_ = (x - p[0], y - p[1])
			c_ = (x - r[0], y - r[1])
			(cro_b, cro_c) = (cross(b, b_), cross(c, c_))
			if cro_b >= 0 and cro_c >= 0:
				continue
			elif cro_b < 0:
				s1.append((x, y))
			elif cro_c < 0:
				s2.append((x, y))
		quickhull(l, p, s1, k)
		quickhull(p, r, s2, k)
	if sd:
		(c, d) = direction(l, r, sd[0])
		p = sd[0]
		for i in range(1, len(sd)):
			(c_, d_) = direction(l, r, sd[i])
			if c * d_ < c_ * d:
				(c, d) = (c_, d_)
				p = sd[i]
		k.append(tuple(p))
		b = (l[0] - p[0], l[1] - p[1])
		c = (p[0] - r[0], p[1] - r[1])
		s1 = []
		s2 = []
		for (x, y) in sd:
			b_ = (x - p[0], y - p[1])
			c_ = (x - r[0], y - r[1])
			(cro_b, cro_c) = (cross(b, b_), cross(c, c_))
			if cro_b <= 0 and cro_c <= 0:
				continue
			elif cro_b > 0:
				s1.append((x, y))
			elif cro_c > 0:
				s2.append((x, y))
		quickhull(l, p, s1, k)
		quickhull(p, r, s2, k)
	return k

def cross(a, b):
	return a[0] * b[1] - a[1] * b[0]

def direction(l, r, p):
	a = r[1] - l[1]
	b = l[0] - r[0]
	return ((a * (p[0] - l[0]) + b * (p[1] - l[1])) ** 2, a ** 2 + b ** 2)
while 1:
	n = int(input())
	if n == 0:
		break
	s = [[float(x) for x in input().split(',')] for i in range(n)]
	s.sort()
	l = tuple(s.pop(0))
	r = tuple(s.pop(-1))
	k = quickhull(l, r, s, [l, r])
	print(n - len(k))


from math import atan2

class Point(object):

	def __init__(self, x, y):
		self.x = x
		self.y = y

class Vector(object):

	def __init__(self, p1, p2):
		self.x = p2.x - p1.x
		self.y = p2.y - p1.y

	def cross(self, other: 'Vector') -> float:
		return self.x * other.y - self.y * other.x

def grahams_scan(a: list):
	a.sort(key=lambda p: p.y)
	(bottom_x, bottom_y) = (a[0].x, a[0].y)
	_a = sorted(a[1:], key=lambda p: atan2(bottom_y - p.y, bottom_x - p.x)) + [a[0]]
	result = [a[0], _a[0]]
	for next_point in _a[1:]:
		while Vector(result[-1], result[-2]).cross(Vector(result[-1], next_point)) >= 0:
			result.pop()
		result.append(next_point)
	return result
while True:
	n = int(input())
	if not n:
		break
	a = [Point(*map(float, input().split(','))) for _ in [0] * n]
	result = grahams_scan(a)
	print(n - len(result) + 1)


eps = 1e-10

def add(a, b):
	return 0 if abs(a + b) < eps * (abs(a) + abs(b)) else a + b

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, p):
		return Point(add(self.x, p.x), add(self.y, p.y))

	def __sub__(self, p):
		return Point(add(self.x, -p.x), add(self.y, -p.y))

	def __mul__(self, d):
		return Point(self.x * d, self.y * d)

	def dot(self, p):
		return add(self.x * p.x, self.y * p.y)

	def det(self, p):
		return add(self.x * p.y, -self.y * p.x)

	def __str__(self):
		return '({}, {})'.format(self.x, self.y)

def convex_hull(ps):
	ps = [Point(x, y) for (x, y) in sorted([(p.x, p.y) for p in ps])]
	upper_hull = get_bounds(ps)
	ps.reverse()
	lower_hull = get_bounds(ps)
	del upper_hull[-1]
	del lower_hull[-1]
	upper_hull.extend(lower_hull)
	return upper_hull

def get_bounds(ps):
	qs = [ps[0], ps[1]]
	for p in ps[2:]:
		while len(qs) > 1 and (qs[-1] - qs[-2]).det(p - qs[-1]) <= 0:
			del qs[-1]
		qs.append(p)
	return qs
while True:
	n = int(input())
	if n == 0:
		break
	points = []
	for i in range(n):
		(x, y) = map(float, input().split(','))
		points.append(Point(x, y))
	print(len(points) - len(convex_hull(points)))


def op(x, y):
	return (complex.conjugate(x) * y).imag

def isrm(q, i, x):
	for j in q:
		if op(i - x, j - x) < 0:
			return False
	return True

def rightmost(p, x):
	for i in [i for i in p if i != x]:
		q = p.copy()
		q.remove(i)
		if isrm(q, i, x):
			return i
	raise ValueError('Do not come here')

def solve(p, pf, orig):
	nx = rightmost(p, orig)
	ni = p.index(nx)
	if pf[ni]:
		return pf
	pf[ni] = True
	return solve(p, pf, nx)
while True:
	p = []
	n = int(input().strip())
	if n == 0:
		break
	for i in range(n):
		(x, y) = list(map(float, input().strip().split(',')))
		p.append(x + y * 1j)
	print(solve(p, [False for _ in range(n)], 2000.0 + 0.0 * 1j).count(False))


def cross(a, b):
	return a.real * b.imag - a.imag * b.real

def convex_hull(p):
	pp = sorted(p, key=lambda x: (x.imag, x.real))
	n = len(pp)
	(ans, j) = ([0] * (n + 1), 0)
	for i in range(n):
		while j > 1 and cross(ans[j - 1] - ans[j - 2], pp[i] - ans[j - 1]) <= 0:
			j -= 1
		ans[j] = pp[i]
		j += 1
	k = j
	for i in range(n - 2, -1, -1):
		while j > k and cross(ans[j - 1] - ans[j - 2], pp[i] - ans[j - 1]) <= 0:
			j -= 1
		ans[j] = pp[i]
		j += 1
	return ans[0:j - 1]
while 1:
	n = int(input())
	if n == 0:
		break
	p = []
	for i in range(n):
		(x, y) = list(map(float, input().split(',')))
		p.append(complex(x, y))
	print(n - len(convex_hull(p)))