var
a, count: integer;
begin
count := 0;
read(a);
while a > 0 do
if a mod 10 = 7 then
count := count + 1;
a := a div 10;
end;
writeln(count);
end.
var
a, count: integer;
begin
count := 0;
read(a);
while a > 0 do
begin
if a mod 10 = 7 then
count := count + 1;
a := a div 10;
end;
writeln(count);
end.