var
count:integer;
begin
write('Введите количество книг '); readln(count);
case count div 10 of
1: writeln(count, ' книг');
else
case count mod 10 of
0, 5..9: writeln(count, ' книг');
1: writeln(count, ' книга');
2..4: writeln(count, ' книги');
end;
end;
end.