#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF 1000000000 #define PI 3.14159265359 #define EPS 1e-12 int main(void) { int n; cin >> n; ll d[20], maxd = -1*INF*2; REP(i, n) { cin >> d[i]; maxd = max(maxd, d[i]); } ll x, y; cin >> x >> y; x = abs(x); y = abs(y); if(x == 0 && y == 0) {cout << 0 << endl; return 0;} //最初から2d以下 if(max(x, y) <= maxd * 2) { //1手で移動できるのが存在するか REP(i, n) { if(d[i] == max(x, y)) {cout << 1 << endl; return 0;} } //存在しなければ2手 cout << 2 << endl; return 0; } else { //2d未満になるまで近づく ll step = (max(x, y)-maxd)/maxd; ll pos = step*maxd; //そこから1手でたどり着けるか REP(i, n) { if(d[i] == max(x, y)-pos) { cout << step+1 << endl; return 0; } } cout << step+2 << endl; } return 0; }