#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<double> r(n), h(n);
  for (long long i = 0; i < n; ++i) {
    cin >> r[i] >> h[i];
  }
  vector<double> v(n);
  for (long long i = 0; i < n; ++i) v[i] = r[i] * r[i] * h[i];
  set<pair<double, double> > st;
  double ans = 0;
  for (long long i = 0; i < n; i++) {
    pair<double, double> p = {v[i], v[i]};
    auto it1 = st.lower_bound(p);
    if (st.size() > 0 and it1 != st.begin()) {
      it1--;
      pair<double, double> pp = *it1;
      p.second = pp.second + p.first;
    }
    while (true) {
      auto it = st.lower_bound(p);
      if (st.size() > 0 and it != st.end() and (*it).second < p.second) {
        st.erase(it);
        continue;
      }
      break;
    }
    st.insert(p);
    ans = max(ans, p.second);
  }
  cout << setprecision(15) << fixed << 3.1415926535897932384626433832795 * ans
       << "\n";
}
