{
TASK:man
LANG:PASCAL
}
program man;
var i,b,c,j,n,m,max,sm:longint;

    A:array[1..10000] of longint;

  procedure sort(l,r:longint);
  var i,j,x,y:longint;

  begin
   i:=l;
   j:=r;
   x:=A[(l+r)div 2];
   repeat
    while a[i] < x do i := i + 1;
    while x < a[j] do j := j - 1;
    if i <= j then
    begin
      y := a[i]; a[i] := a[j]; a[j] := y;
      i := i + 1; j := j - 1;
    end;
  until i > j;
  if l < j then Sort(l, j);
  if i < r then Sort(i, r);


  end;


begin
readln(m);  max:=0;
for i :=0 to m do

  A[i]:=0;

for i :=1 to m do
 begin
  read(c);if c>max then  max:=c; A[i]:=c;
  readln(b);if b>max then max:=b;

 end;
 n:=max;
 sort(1,m);
 sm:=m;
 for i:=2 to m do
  if A[i]=A[i-1] then
   dec(sm);
writeln(sm);
end.