#include <bits/stdc++.h>
using namespace std;
long long ans;
long long n, d, m;
const int MAXM = 200005;
long long L = 1;
long long R = 1;
long long amount[MAXM];
long long price[MAXM];
long long totalAmount;
long long currPos;
struct st {
  int position, cost;
  st(int a, int b) {
    position = a;
    cost = b;
  }
  bool operator<(st const &drugi) const { return position < drugi.position; }
};
vector<st> stations;
void out() { cout << "-1" << endl; }
bool Move(int pos) {
  long long dist = pos - currPos;
  if (dist > totalAmount) return false;
  while (dist > 0) {
    long long t = min(amount[L], dist);
    amount[L] -= t;
    dist -= t;
    if (amount[L] == 0) L++;
    totalAmount -= t;
  }
  currPos = pos;
  return true;
}
void buy(long long p) {
  while (R >= L && price[R] > p) {
    ans -= price[R] * amount[R];
    totalAmount -= amount[R];
    R--;
  }
  long long tobuy = n - totalAmount;
  if (tobuy) {
    R++;
    ans += p * tobuy;
    price[R] = p;
    amount[R] = tobuy;
  }
  totalAmount = n;
}
void sellAll() {
  while (R >= L) {
    ans -= price[R] * amount[R];
    R--;
  }
}
int main() {
  cin >> d >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, p;
    scanf("%d%d", &x, &p);
    stations.push_back(st(x, p));
  }
  sort(stations.begin(), stations.end());
  amount[1] = n;
  price[1] = 0;
  totalAmount = n;
  for (int i = 0; i < m; i++) {
    if (!Move(stations[i].position)) {
      out();
      return 0;
    }
    buy(stations[i].cost);
  }
  if (!Move(d)) {
    out();
    return 0;
  }
  sellAll();
  cout << ans << endl;
  return 0;
}
