#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 15;
pair<int, int> v[N];
void solve() {
  int n, d, i, x, u, p, m;
  long long ret = 0;
  cin >> d >> n >> m;
  for (i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &p);
    v[i] = make_pair(x, p);
  }
  sort(v + 1, v + m + 1);
  v[0] = make_pair(0, 1e9);
  v[m + 1] = make_pair(d, 0);
  m += 2;
  for (i = 1; i < m; ++i)
    if (v[i - 1].first + n < v[i].first) {
      printf("-1\n");
      return;
    }
  x = 0;
  int j = 0, rem = n;
  p = 1e9;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      s, q;
  while (x != d) {
    while (j < m) {
      if (x + n >= v[j].first) {
        s.push(make_pair(v[j].second, v[j].first));
        q.push(make_pair(v[j].first, v[j].second));
        ++j;
      } else
        break;
    }
    while (!s.empty()) {
      if (s.top().second <= x)
        s.pop();
      else
        break;
    }
    while (!q.empty()) {
      if (q.top().first <= x)
        q.pop();
      else
        break;
    }
    bool is = 1;
    if (!s.empty()) {
      if (s.top().first >= p) {
        int dist = s.top().second - x;
        int need = n - rem;
        ret += (long long)need * p;
        x = s.top().second;
        p = s.top().first;
        rem = rem + need - dist;
        continue;
      } else
        is = 0;
    } else
      is = 0;
    while (!q.empty()) {
      if (q.top().second < p) {
        int dist = q.top().first - x;
        int need = max(0, dist - rem);
        ret += (long long)need * p;
        x = q.top().first;
        p = q.top().second;
        rem = rem + need - dist;
      } else
        q.pop();
    }
  }
  cout << ret << endl;
}
int main() { solve(); }
