#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[350000];
int main() {
  long long ans = -1, n, k, u, v, sum = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> u >> v;
    a[i] = make_pair(v, u);
  }
  sort(a + 1, a + 1 + n);
  for (int i = n; i >= 1; i--) {
    sum += a[i].second;
    ans = max(ans, sum * a[i].first);
  }
  cout << ans << endl;
  return 0;
}
