#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, *a, cost = 0;
  cin >> n >> d;
  cost = d;
  int maxcost = d, j;
  a = new int[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      cost = ((d / a[i]) * a[j]) + (d % a[i]);
      if (cost > maxcost) maxcost = cost;
    }
  }
  cout << maxcost << "\n";
  return 0;
}
