import std.stdio;
import std.algorithm;
import std.conv;
import std.array;
import std.string;
import std.math;
import std.functional;
import std.range;

void main(string[] args) {
  readln;
  readln.solve.writeln;
}

auto solve(string input) {
  return input.split.map!(to!int).map!(a => divCount(a, 2)).minElementAlt;
  // return input.split.map!(to!int).map!(a => divCount(a, 2)).minElement;
}

unittest {
  assert(solve("8 12 40") == 2, "1");
  assert(solve("5 6 8 10") == 0, "2");
  assert(solve("382253568 723152896 37802240 379425024 404894720 471526144") == 8, "3");
}

// ----------------------------------------

pure auto minElementAlt(Range)(Range r) 
if (isInputRange!Range && !isInfinite!Range) {
  import std.algorithm: min;
  auto res = r.front;
  foreach(v; r) {
    res = min(v, res);
  }
  return res;
} unittest {
  assert([4, 6, 3, 0, 1].minElementAlt == 0);
}


pure auto divCount(int n, int base) {
  auto count = 0;
  while (n % base == 0) {
    n /= base;
    count++;
  }
  return count;
} unittest {
  assert(divCount(12, 2) == 2);
  assert(divCount(125, 2) == 0);
  assert(divCount(81, 3) == 4);
}