#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
inline void read(long long &x) {
  x = 0;
  long long f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
inline void judge() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
long long d, n, m;
struct info {
  long long x, p;
} a[maxn];
inline bool cmp1(const info &a, const info &b) { return a.x < b.x; }
inline bool operator<(const info &a, const info &b) {
  return a.p < b.p || (a.p == b.p && a.x < b.x);
}
long long sum[maxn];
set<info> zball;
long long nowfull, ans, nowoil;
int main() {
  read(d);
  read(n);
  read(m);
  for (int i = (1); i <= (m); i++) {
    long long x, p;
    read(x);
    read(p);
    a[i] = (info){x, p};
  }
  nowfull = 0;
  sort(a + 1, a + 1 + m, cmp1);
  a[m + 1].x = d;
  for (int i = (1); i <= (m + 1); i++) {
    if (a[i].x - a[i - 1].x > n) {
      puts("-1");
      return 0;
    }
  }
  nowoil = n;
  for (int i = (1); i <= (m); i++) {
    int j = i;
    if (nowoil >= d) break;
    while (j <= m && a[j + 1].x <= nowoil) j++;
    for (int k = (i); k <= (j); k++) zball.insert(a[k]);
    long long res = a[j + 1].x - nowoil;
    while (res != 0) {
      info tmp = *zball.begin();
      long long ads = min(res, n - (nowoil - tmp.x));
      ads = max(ads, 0ll);
      res -= ads;
      nowoil += ads;
      ans += ads * tmp.p;
      if (ads == 0) zball.erase(tmp);
    }
    if (nowoil >= d) break;
    i = j;
  }
  cout << ans;
  return 0;
}
