#include <bits/stdc++.h>
using namespace std;
const int maxn = 200020;
struct Station {
  int x, p;
  Station(int x = 0, int p = 0) : x(x), p(p) {}
  void input() { scanf("%d %d", &x, &p); }
} gs[maxn];
int nxt[maxn];
inline bool operator<(const Station& lhs, const Station& rhs) {
  return lhs.x < rhs.x;
}
int main() {
  int d, n, m;
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 0; i < m; ++i) gs[i].input();
  gs[m] = Station(d, 0);
  sort(gs, gs + m);
  nxt[m - 1] = m;
  for (int i = m - 2; i >= 0; --i) {
    int t = i + 1;
    while (gs[t].p > gs[i].p) t = nxt[t];
    nxt[i] = t;
  }
  bool flag = true;
  int gas = n, pre = 0;
  long long res = 0;
  for (int i = 0; i < m; ++i) {
    gas -= gs[i].x - pre;
    if (gas < 0) {
      flag = false;
      break;
    }
    int rgas = min(n, gs[nxt[i]].x - gs[i].x);
    if (rgas > gas) {
      res += (rgas - gas) * 1ll * gs[i].p;
      gas = rgas;
    }
    pre = gs[i].x;
  }
  gas -= gs[m].x - pre;
  if (gas < 0) flag = false;
  if (flag)
    printf("%lld\n", res);
  else
    puts("-1");
  return 0;
}
