#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 7;
long long read() {
  long long res = 0;
  long long f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (isdigit(c)) res = (res << 1) + (res << 3) + c - 48, c = getchar();
  return res * f;
}
struct node {
  int x, y;
  friend bool operator<(const node& a, const node& b) {
    if (a.y == b.y) return a.x > b.x;
    return a.y > b.y;
  }
};
priority_queue<node> q;
pair<int, int> p[maxn];
int n, m, d, ans;
int main() {
  d = read(), n = read(), m = read();
  for (int i = 1; i <= m; i++) scanf("%d%d", &p[i].first, &p[i].second);
  p[m + 1] = make_pair(d, 0);
  sort(p + 1, p + 1 + m);
  long long ans = 0;
  q.push(node{0, 0});
  for (int i = 0; i <= m; i++) {
    int now = p[i].first;
    int dis = p[i + 1].first - p[i].first;
    if (dis > n) return puts("-1");
    while (dis) {
      while (q.size() && q.top().x + n <= now) q.pop();
      node noww = q.top();
      int d = min(dis, n - now + noww.x);
      dis -= d;
      now += d;
      ans += 1ll * d * noww.y;
    }
    q.push(node{p[i + 1].first, p[i + 1].second});
  }
  printf("%lld\n", ans);
  return 0;
}
