Pagini recente » Cod sursa (job #882858) | Cod sursa (job #2080050) | Cod sursa (job #2257931) | Cod sursa (job #904252) | Cod sursa (job #1089101)
var i,j,n,m,x,y,k:longint;
u:byte;
a:array[1..1000,1..1000] of byte;
begin
assign(input,'dfs.in');
assign(output,'dfs.out');
reset(input);
rewrite(output);
read(n); readln(m);
for i:=1 to m do
begin
read(x); readln(y);
a[x][y]:=1;
end;
k:=n;
for i:=1 to n do
begin
u:=1;
for j:=i to n do
begin
if u=1 then
if a[i][j]=1 then u:=0;
if j=n then if u=1 then dec(k);
end;
end;
writeln(k+1);
close(input);
close(output);
{Totusi este trist in lume}
end.