
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;



@SuppressWarnings("unused")
public class C {

  static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
  public static void main(String[] args) throws Exception {
    new C().go();
  }


  Scanner in;
  String INPUT = "5 3\n" +
      "12 31\n" +
      "112 4\n" +
      "100 100\n" +
      "13 55\n" +
      "55 50";

  void go() {
    if (LOCAL) {
      System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
    }
    in = new Scanner(System.in);
    long startTime = System.currentTimeMillis();
    solve();
    if (LOCAL) {
      // System.out.printf("[%dms]", System.currentTimeMillis()-startTime);
    }
    in.close();
  }


  PrintWriter out = new PrintWriter(System.out);
  StringBuffer sb = new StringBuffer();


  class Song implements Comparable<Song> {
    int length;
    int beauty;
    Song(int length, int beauty) {
      this.length = length;
      this.beauty = beauty;
    }
    @Override
    public int compareTo(Song arg0) {
      return arg0.beauty-beauty;
    }
  }



  void solve() {

    int n = in.nextInt();
    int k = in.nextInt();

    List<Song> songs = new ArrayList<>();

    for (int i = 0; i < n; i++) {
      int length = in.nextInt();
      int beauty = in.nextInt();
      songs.add(new Song(length, beauty));
    }

    Collections.sort(songs);

    int maxPleasure = 0;
    int lengthCount = 0;

    for (Song s : songs) {
      lengthCount += s.length;
      // System.out.println(lengthCount * s.beauty);
      maxPleasure = Math.max(maxPleasure, lengthCount*s.beauty);
    }

    System.out.println(maxPleasure);


  } // end of solve


}


