program Paskalio_trikampis;
  { 15 u‘davinys }
  function trikampis (n : integer) : integer;
  { did‘iausias Paskalio trikampis iž N degtuk— }
    var eil, d_sk : integer;
  begin
    eil := 0; d_sk := 1;
    while n > d_sk do
      begin
        n := n - d_sk;
        eil := eil + 1;
        d_sk := d_sk * 2
      end;
    if n = d_sk
       then eil := eil + 1;
    trikampis := eil
  end;
  var n : integer;
begin
  write ('­veskite degtuk— skai‡i—: ');
  readln (n);
  writeln (trikampis (n));
end.