 lilpeeprip2 
                                                03.05.2021 12:52
                                                
                                                lilpeeprip2 
                                                03.05.2021 12:52
                                             0101015 
                                                03.05.2021 12:49
                                                
                                                0101015 
                                                03.05.2021 12:49
                                             erasildamir 
                                                03.05.2021 12:46
                                                
                                                erasildamir 
                                                03.05.2021 12:46
                                             Jand9 
                                                03.05.2021 12:44
                                                
                                                Jand9 
                                                03.05.2021 12:44
                                             МашаКан 
                                                03.05.2021 12:44
                                                
                                                МашаКан 
                                                03.05.2021 12:44
                                             mriya1987 
                                                03.05.2021 12:42
                                                
                                                mriya1987 
                                                03.05.2021 12:42
                                             Бокс111 
                                                03.05.2021 12:41
                                                
                                                Бокс111 
                                                03.05.2021 12:41
                                             farsama 
                                                03.05.2021 12:32
                                                
                                                farsama 
                                                03.05.2021 12:32
                                            
begin
read(n);
for i:=1 to n do begin
read(m,s);
if (m<18) then inc(kol);
if (m=18) and (s<=30) then inc(kol);
end;
writeln(kol);
end.