#include <bits/stdc++.h>
using namespace std;
struct station {
  int x, p;
} stat[200005];
stack<int> s;
int nxt[200005];
bool comp(station a, station b) { return a.x < b.x; }
int main() {
  int d, n, m;
  long long ans = 0;
  scanf("%d %d %d", &d, &n, &m);
  int p = 0;
  int gas = n;
  int i;
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &stat[i].x, &stat[i].p);
  }
  sort(stat + 1, stat + m + 1, comp);
  stat[m + 1].x = d;
  stat[0].p = 1e7;
  s.push(m + 1);
  for (i = m; i >= 0; i--) {
    while (s.empty() == false && stat[i].p < stat[s.top()].p) {
      s.pop();
    }
    nxt[i] = s.top();
    s.push(i);
  }
  for (; p <= m;) {
    int np = nxt[p];
    if (stat[np].x - stat[p].x <= gas) {
      gas -= stat[np].x - stat[p].x;
      p = np;
    } else if (stat[np].x - stat[p].x <= n) {
      ans += 1LL * (stat[np].x - stat[p].x - gas) * stat[p].p;
      gas = 0;
      p = np;
    } else if (stat[p + 1].x - stat[p].x <= n) {
      ans += 1LL * (n - gas) * stat[p].p;
      gas = n;
      gas -= stat[p + 1].x - stat[p].x;
      p++;
    } else {
      printf("-1");
      return 0;
    }
  }
  printf("%I64d", ans);
  return 0;
}
