#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 10;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
int n;
vector<long double> v;
long double V[N];
long double f[N];
void add(int x, long double y) {
  for (; x < N; x |= x + 1) {
    f[x] = max(f[x], y);
  }
}
long double get(int x) {
  long double ret = 0.0;
  for (; x >= 0; x = (x & (x + 1)) - 1) {
    ret = max(ret, f[x]);
  }
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long double R, H;
    cin >> R >> H;
    V[i] = R * R * H;
    v.push_back(V[i]);
  }
  sort(v.begin(), v.end());
  long double ans = 0.0;
  cout.precision(10);
  for (int i = 0; i < n; ++i) {
    int t = lower_bound(v.begin(), v.end(), V[i]) - v.begin();
    long double now = get(t - 1) + V[i];
    ans = max(now, ans);
    add(t, now);
  }
  cout << fixed << ans * 3.141592653589793;
  return 0;
}
