#include <bits/stdc++.h>
using namespace std;
void prep(const int m, const int n,
          const vector<pair<long long, long long> >& a, vector<int>& b) {
  for (int i = 0; i <= n; i++) {
    if (a[i + 1].first - a[i].first > m) {
      b.clear();
      return;
    }
  }
  stack<int> S;
  S.push(n + 1);
  for (int i = n; i >= 0; i--) {
    for (; a[i].second < a[S.top()].second; S.pop())
      ;
    b[i] = S.top();
    S.push(i);
  }
}
int main() {
  int d, m, n;
  scanf("%d%d%d", &d, &m, &n);
  vector<pair<long long, long long> > a(n + 2);
  a[0] = pair<long long, long long>(0, 0);
  a[n + 1] = pair<long long, long long>(d, -1);
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d", &a[i].first, &a[i].second);
  sort(a.begin(), a.end());
  vector<int> b(n + 2, n + 1);
  prep(m, n, a, b);
  if (b.empty()) {
    printf("-1\n");
    return 0;
  }
  long long ans = 0, c = 0;
  for (int i = 0; i <= n;) {
    if (a[b[i]].first > a[i].first + m) {
      ans += a[i].second * (m - c);
      c = m - (a[i + 1].first - a[i].first);
      i++;
    } else {
      ans += a[i].second * max(0LL, a[b[i]].first - a[i].first - c);
      c = max(c, a[b[i]].first - a[i].first) - (a[b[i]].first - a[i].first);
      i = b[i];
    }
  }
  printf("%I64d\n", ans);
}
