#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

struct p{
    double x,y;
};

void sort(struct p p[105], int n){
    rep(i,n){
        rep(j,n - 1){
            if(p[j].x > p[j + 1].x){
                struct p temp = p[j];
                p[j] = p[j + 1];
                p[j + 1] = temp;
            }
        }
    }
}

int main(){
    int n;
    while(cin >> n,n){
        struct p p[105];
        vector<struct p> u;
        vector<struct p> l;
        rep(i, n){
            char g;
            cin >> p[i].x >> g >> p[i].y;
        }
        sort(p, n);

        u.pb(p[0]);
        u.pb(p[1]);
        l.pb(p[n-1]);
        l.pb(p[n-2]);

        range(i,2,n){
            while(u[u.size() - 2].y > u[u.size() - 1].y && u[u.size() - 1].y < p[i].y){
                u.pop_back();
            }
            u.pb(p[i]);
        }
        for(int i = n - 1; i >= 2; i--){
            while(l[l.size() - 2].y < l[l.size() - 1].y  && l[l.size() - 1].y > p[i].y){
                l.pop_back();
            }
            l.pb(p[i]);
        }

        cout << n - u.size() << endl;
    }
}