program faktorialo_skaidymas;
  { 1 u‘davinys }
  {----------------------------------------------------------}
  function kiek (n : integer) : integer;
    var k, i : integer;
    function daug (x : integer) : integer;
      { kiek pirmini— daugikli— turi skai‡ius x }
      var k, d : integer;
    begin
      k := 0;
      while x mod 2 = 0 do
        begin            { x dalijasi iž 2 }
          k := k + 1;
          x := x div 2
        end;
      d := 3;
      while d <= x do
        if x mod d = 0   { x dalijasi iž d }
           then begin
                  k := k + 1;
                  x := x div d
                end
           else d := d + 2; { imamas kitas }
                      { nelyginis daliklis }
      daug := k
    end;
  begin
    k := 0;
    for i := 1 to n do { n! = 1 * 2 * 3 * ... * n }
      k := k + daug (i);
    kiek := k
  end;
{----------------------------------------------------------}
  var n, daugikl : integer;
begin
  write ('­veskite duot… skai‡i—: ');
  readln (n);
  daugikl := kiek (n);
  writeln (daugikl)
end.
