#include <bits/stdc++.h>
using namespace std;
int d, n, m, q[200005], l, h;
long long ans;
pair<int, int> x[200005];
int main() {
  scanf("%d %d %d", &d, &n, &m);
  for (int i = (1); i <= (m); i++) scanf("%d %d", &x[i].first, &x[i].second);
  x[m + 1].first = d;
  sort(x, x + m + 2);
  q[h++] = 0;
  for (int i = (1); i <= (m + 1); i++) {
    int f = x[i].first - x[i - 1].first;
    if (f > n) {
      puts("-1");
      return 0;
    }
    while (f) {
      int p = q[l], t = n - x[i].first + f + x[p].first;
      if (t <= 0) {
        l++;
        continue;
      }
      int a = min(f, t);
      f -= a;
      ans += (long long)a * x[p].second;
    }
    while (l < h && x[q[h - 1]].second >= x[i].second) h--;
    q[h++] = i;
  }
  printf("%I64d\n", ans);
  scanf("\n");
}
