program jaisamoja;
var n,br:integer;
var i:cardinal;
procedure uradi(n:integer; var br : integer);

begin

    while n>4 do
    begin
        n:=n-5;
        br:= br+1;
    end;
    
     while n>1 do
    begin
        n:=n-2;
        br:= br+1;
    end;
    
     while n>0 do
    begin
        n:=n-1;
        br:= br+1;
    end;
    
    


end;
begin
br:=0;
  read(i);
  
  while i>0 do
  begin
  n:=i mod 10;
  i:= i div 10;
  uradi(n,br);
  
  end;
 write(br);
end.