Buggy python submission (verdict: Runtime Error):
def f(x,y,x1,y1,x2,y2):
    if x1 <= x2:
        return (x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1
    else:
        return -((x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1)

def DC(a):
    if len(a) > 3:
        # Divide
        la = a[:len(a)/2]
        ra = a[len(a)/2:]
        la,ra = DC(la),DC(ra)
        # Conquer
        if len(la) == 1 or len(ra) == 1:
            return la+ra
        else:
            while f(ra[1][0],ra[1][1],la[-1][0],la[-1][1],ra[0][0],ra[0][1]) > 0:
                ra.pop(0)
            while f(la[-2][0],la[-2][1],ra[0][0],ra[0][1],la[-1][0],la[-1][1]) > 0:
                la.pop(-1)
            return la+ra
    else:
        return a

while True:
    n = int(raw_input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(map(float, raw_input().split(",")))
    p = sorted(p, key = lambda x: x[0])
    print n - len(DC(p))

Fixed submission:
def a(v1,v2):
	if v1[0] != v2[0]:
		return (v2[1]-v1[1])/(v2[0]-v1[0])
	else:
		return (v2[1]-v1[1])*(10**10)
def dlt(p,v,sign):
	while len(p) > 2:
		if sign*(a(v[p[-3]],v[p[-2]]) - a(v[p[-2]],v[p[-1]])) < 0:
			del p[-2]
		else:
			break
	return p
def convex(v,n):
	d,u = [],[]
	for i in range(n):
		d = dlt(d+[i],v,1)
		u = dlt(u+[i],v,-1)
	return n - len(set(d+u))
while 1:
	n = input()
	if n == 0: break
	v = [map(float,raw_input().split(",")) for i in range(n)]
	v = sorted(sorted(v, key = lambda x:x[1]))
	print convex(v,n)

Buggy python submission (verdict: Runtime Error):
def f(x,y,x1,y1,x2,y2):
    if x1 <= x2:
        return (x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1
    else:
        return -((x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1)

def DC(a):
    if len(a) > 3:
        # Divide
        la = a[:len(a)/2]
        ra = a[len(a)/2:]
        la,ra = DC(la),DC(ra)
        # Conquer
        if len(la) == 1 or len(ra) == 1:
            return la+ra
        else:
            while f(ra[1][0],ra[1][1],la[-1][0],la[-1][1],ra[0][0],ra[0][1]) > 0:
                ra.pop(0)
            while f(la[-2][0],la[-2][1],ra[0][0],ra[0][1],la[-1][0],la[-1][1]) > 0:
                la.pop(-1)
            return la+ra
    else:
        return a

while True:
    n = int(raw_input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(map(float, raw_input().split(",")))
    p = sorted(p, key = lambda x: x[0])
    print n - len(DC(p))

Fixed submission:
def a(v1,v2):
	if v1[0] != v2[0]:
		return (v2[1]-v1[1])/(v2[0]-v1[0])
	else:
		return (v2[1]-v1[1])*(10**10)
def dlt(p,v,sign):
	while len(p) > 2:
		if sign*(a(v[p[-3]],v[p[-2]]) - a(v[p[-2]],v[p[-1]])) < 0:
			del p[-2]
		else:
			break
	return p
def convex(v,n):
	d,u = [],[]
	for i in range(n):
		d = dlt(d+[i],v,1)
		u = dlt(u+[i],v,-1)
	return n - len(set(d+u))
while 1:
	n = input()
	if n == 0: break
	v = [map(float,raw_input().split(",")) for i in range(n)]
	v = sorted(sorted(v, key = lambda x:x[1]))
	print convex(v,n)

Buggy python submission (verdict: Runtime Error):
def f(x,y,x1,y1,x2,y2):
    if x1 <= x2:
        return (x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1
    else:
        return -((x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1)

def DC(a):
    if len(a) > 3:
        # Divide
        la = a[:len(a)/2]
        ra = a[len(a)/2:]
        # Conquer
        la,ra = DC(la),DC(ra)
        while f(ra[1][0],ra[1][1],la[-1][0],la[-1][1],ra[0][0],ra[0][1]) > 0 and len(ra) > 1:
            ra.pop(0)
        while f(la[-2][0],la[-2][1],ra[0][0],ra[0][1],la[-1][0],la[-1][1]) > 0 and len(la) > 1:
            la.pop(-1)
        return la+ra
    else:
        return a

while True:
    n = int(raw_input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(map(float, raw_input().split(",")))
    p = sorted(p, key = lambda x: x[0])
    print n - len(DC(p))

Fixed submission:
def a(v1,v2):
	if v1[0] != v2[0]:
		return (v2[1]-v1[1])/(v2[0]-v1[0])
	else:
		return (v2[1]-v1[1])*(10**10)
def dlt(p,v,sign):
	while len(p) > 2:
		if sign*(a(v[p[-3]],v[p[-2]]) - a(v[p[-2]],v[p[-1]])) < 0:
			del p[-2]
		else:
			break
	return p
def convex(v,n):
	d,u = [],[]
	for i in range(n):
		d = dlt(d+[i],v,1)
		u = dlt(u+[i],v,-1)
	return n - len(set(d+u))
while 1:
	n = input()
	if n == 0: break
	v = [map(float,raw_input().split(",")) for i in range(n)]
	v = sorted(sorted(v, key = lambda x:x[1]))
	print convex(v,n)

Buggy python submission (verdict: Runtime Error):
def f(x,y,x1,y1,x2,y2):
    if x1 <= x2:
        return (x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1
    else:
        return -((x2-x1)*y-(y2-y1)*x+x1*y2-x2*y1)

def DC(a):
    if len(a) > 3:
        # Divide
        la = a[:len(a)/2]
        ra = a[len(a)/2:]
        # Conquer
        la,ra = DC(la),DC(ra)
        while f(ra[1][0],ra[1][1],la[-1][0],la[-1][1],ra[0][0],ra[0][1]) > 0 and len(ra) > 1:
            ra.pop(0)
        while f(la[-2][0],la[-2][1],ra[0][0],ra[0][1],la[-1][0],la[-1][1]) > 0 and len(la) > 1:
            la.pop(-1)
        return la+ra
    else:
        return a

while True:
    n = int(raw_input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(map(float, raw_input().split(",")))
    p = sorted(p, key = lambda x: x[0])
    print n - len(DC(p))

Fixed submission:
def a(v1,v2):
	if v1[0] != v2[0]:
		return (v2[1]-v1[1])/(v2[0]-v1[0])
	else:
		return (v2[1]-v1[1])*(10**10)
def dlt(p,v,sign):
	while len(p) > 2:
		if sign*(a(v[p[-3]],v[p[-2]]) - a(v[p[-2]],v[p[-1]])) < 0:
			del p[-2]
		else:
			break
	return p
def convex(v,n):
	d,u = [],[]
	for i in range(n):
		d = dlt(d+[i],v,1)
		u = dlt(u+[i],v,-1)
	return n - len(set(d+u))
while 1:
	n = input()
	if n == 0: break
	v = [map(float,raw_input().split(",")) for i in range(n)]
	v = sorted(sorted(v, key = lambda x:x[1]))
	print convex(v,n)