#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
struct gas {
  int id, x, p;
  friend bool operator<(gas A, gas B) { return A.p > B.p; }
} g[maxn];
bool cmp(gas A, gas B) { return A.x < B.x; }
int main(void) {
  int n, d, m;
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 0; i < m; i++) scanf("%d %d", &g[i].x, &g[i].p);
  sort(g, g + m, cmp);
  long long ans = 0LL;
  priority_queue<gas> pq;
  int t = 0, now = n;
  while (now < d) {
    while (t < m && g[t].x <= now) pq.push(g[t++]);
    while (!pq.empty() && pq.top().x <= now - n) pq.pop();
    if (pq.empty()) return puts("-1");
    int x = pq.top().x, p = pq.top().p;
    int nxt = min(d, x + n);
    if (t < m && nxt >= g[t].x) nxt = g[t].x;
    ans += (long long)p * (nxt - now);
    now = nxt;
  }
  printf("%I64d\n", ans);
  return 0;
}
