#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
struct gas {
  int x, c;
};
int d, n, m, j;
gas v[N];
bool cmp(gas a, gas b) { return a.x < b.x; }
int s[N], p, u;
void add(int &j) {
  while (p <= u && v[s[u]].c >= v[j].c) --u;
  s[++u] = j;
  ++j;
}
int main() {
  int i;
  cin >> d >> n >> m;
  for (i = 1; i <= m; ++i) {
    scanf("%d%d", &v[i].x, &v[i].c);
  }
  sort(v + 1, v + m + 1, cmp);
  for (i = 1; i <= m; ++i) {
    if (v[i].x - v[i - 1].x > n) {
      cout << "-1";
      return 0;
    }
  }
  if (d - v[m].x > n) {
    cout << "-1";
    return 0;
  }
  long long cost = 0;
  int pozc = 0, dmax = n;
  p = 1;
  j = 1;
  while (pozc <= d) {
    if (dmax >= d) break;
    while (j <= m && v[j].x <= dmax) {
      add(j);
    }
    while (j <= m && v[j].x - v[s[p]].x <= n) {
      cost += 1LL * (v[j].x - dmax) * (v[s[p]].c);
      dmax = v[j].x;
      add(j);
    }
    int newd = min(d, v[s[p]].x + n);
    cost += 1LL * (newd - dmax) * v[s[p]].c;
    pozc = v[s[p]].x;
    dmax = newd;
    ++p;
  }
  cout << cost;
  return 0;
}
