#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int link[200100];
int main() {
  int d, n, m;
  scanf("%i%i%i", &d, &n, &m);
  int x, p;
  for (int i = 0; i < m; i++) {
    scanf("%i%i", &x, &p);
    v.push_back(make_pair(x, p));
  }
  v.push_back(make_pair(0, 0));
  v.push_back(make_pair(d, 0));
  sort(v.begin(), v.end());
  stack<int> s;
  for (int i = (int)v.size() - 1; i >= 0; i--) {
    if (s.empty()) {
      link[i] = v.size();
      s.push(i);
    } else {
      while (v[s.top()].second > v[i].second) {
        s.pop();
      }
      if (s.empty()) {
        link[i] = v.size();
      } else {
        link[i] = s.top();
      }
      s.push(i);
    }
  }
  for (int i = 1; i < v.size(); i++) {
    if (v[i].first - v[i - 1].first > n) {
      puts("-1");
      return 0;
    }
  }
  int curr = n;
  long long ans = 0;
  for (int i = 0; i < v.size() - 1;) {
    if (v[link[i]].first - v[i].first > n) {
      ans += 1ll * (n - curr) * 1ll * v[i].second;
      curr = n - (v[i + 1].first - v[i].first);
      i++;
    } else {
      int dd = v[link[i]].first - v[i].first;
      ans += 1ll * max(0, dd - curr) * 1ll * v[i].second;
      curr = max(curr, dd) - dd;
      i = link[i];
    }
  }
  printf("%I64d", ans);
  return 0;
}
