program Project2; {$APPTYPE CONSOLE} uses SysUtils; type mas=array[1..200000,1..2]of longint; var a:mas; n,i,j,res:longint; procedure swap(var a,b:longint); var key:longint; begin key:=a; a:=b; b:=key; end; function partition(var A:mas;p,r:longint):longint; var x,i,j:longint; begin x:=A[r,1]; i:=p-1; for j:=p to r-1 do if (A[j,1]a[i,2] then swap(a[i,1],a[i,2]); end; close(input); qsort(a,1,n); for i:=2 to n do if a[i,2]>=a[i-1,2]then inc(res); assign(output,'task.out'); rewrite(output); writeln(res); close(output); end.