{$apptype console}
{$r+,o-}

var
  k, m, i, ps : longint;
  deg : int64;
  s : string;

function check(num : int64) : longint;
var
  j, pos, num0: longint;
  cur : array[1..1000] of longint;
begin
  pos := 1;
  num0 := num;
  fillchar(cur, sizeof(cur), 0);
  while(num > 0) do
  begin
    cur[pos] := num mod 10;
    num := num div 10;
    inc(pos);
  end;

  pos := 1;
  for j := 1 to m - k do
  begin
    if (cur[pos] > 4) then inc(cur[pos + 1]);
    inc(pos);
  end;

  result := 0;
  if cur[pos] = longint(s[length(s)]) - longint('0') then
    result := 1;
end;

var
  ans : int64;


begin
  reset(input, 'rounding.in');
  rewrite(output, 'rounding.out');
  readln(m);
  readln(s);

  k := length(s);
  ps := -1;
  for i := 1 to k do
  begin
    if s[i] = '.' then
    begin
      ps := i;
      break;
    end;
  end;

  k := k - ps;

  assert(ps > 0);
  assert(k < m);

  deg := 1;
  for i := 1 to m - k + 1 do
    deg := deg * int64(10);

  ans := 0;

  for i := 0 to deg - 1 do
    inc(ans, check(i));

  writeln(ans);
end.