Pagini recente » Cod sursa (job #2118610) | Cod sursa (job #3177382) | Cod sursa (job #1779066) | Cod sursa (job #701443) | Cod sursa (job #316886)
Cod sursa(job #316886)
program text;
var s:string;
j,i,n:integer;
p,q:boolean;
begin
assign(input,'text.in');
assign(output,'text.out');
reset(input);
rewrite(output);
readln(input,s);
i:=0;
j:=0;
n:=0;
while i<>length(s)+1 do
begin
p:=((s[i]>='a')and(s[i]<='z'))or((s[i]>='A')and(s[i]<='Z'));
q:=not(((s[i+1]>='a')and(s[i+1]<='z'))or((s[i+1]>='A')and(s[i+1]<='Z')));
if p then
j:=j+1 ;
if (p and q)or(p and (i=length(s))) then n:=n+1;
i:=i+1;
end;
if n<>0 then writeln(output,j div n);
close(input);
close(output);
end.