#!/usr/bin/perl

if (!$ARGV[0]) { die "Usage: $0 filename\n"; };
$fname = $ARGV[0];

open FILE, "<$fname" or die "Error cant't open $fname\n";
@data = grep { /^\<LI\>|Намерени\ са/ } <FILE>;
close FILE;

$num = shift @data;
$num =~ s/.*<B\>(\d*)<\/B\>.*/$1/;
for ($i=0; $i<=$#data; $i++) {
    $data[$i] =~ s/.*?\"//;
    $data[$i] =~ s/\"\>/;/;
    $data[$i] =~ s/\<.*\>//;
};
if (!$num) { $num = 0; };
print @data;
print $num;
exit;
