#include <bits/stdc++.h>
using namespace std;
const int N = 200500;
int d, n, m;
pair<int, int> gas[N];
vector<int> p;
int t[4 * N];
pair<int, int> border[4 * N];
void build(int v, int tl, int tr) {
  border[v] = make_pair(tl, tr);
  if (tl == tr) {
    t[v] = gas[tl].second;
  } else {
    int tm = (tl + tr) >> 1;
    build(v * 2, tl, tm);
    build(v * 2 + 1, tm + 1, tr);
    if (t[v * 2] < t[v * 2 + 1])
      t[v] = t[v * 2];
    else
      t[v] = t[v * 2 + 1];
  }
}
void go(int v, int tl, int tr, int l, int r) {
  if (l > r) return;
  if (tl == l && tr == r)
    p.push_back(v);
  else {
    int tm = (tl + tr) >> 1;
    go(v * 2, tl, tm, l, min(r, tm));
    go(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
  }
}
int pos(int v, int tl, int tr, int x) {
  if (tl == tr) return tl;
  int tm = (tl + tr) >> 1;
  if (t[v * 2] <= x)
    return pos(v * 2, tl, tm, x);
  else
    return pos(v * 2 + 1, tm + 1, tr, x);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> d >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> gas[i].first >> gas[i].second;
  }
  sort(gas + 1, gas + m + 1);
  build(1, 1, m);
  int fuel = n;
  gas[m + 1].first = d;
  int r = 0;
  long long answer = 0;
  for (int i = 0; i <= m;) {
    if (i == m) {
      if (d - gas[i].first > n) {
        cout << -1;
        return 0;
      }
      if (fuel < d - gas[i].first) {
        answer += (long long)gas[i].second * (d - gas[i].first - fuel);
      }
      break;
    }
    r = max(r, i);
    while (r < m && gas[r + 1].first - gas[i].first <= n) ++r;
    if (i == r) {
      cout << -1;
      return 0;
    }
    p.clear();
    go(1, 1, m, i + 1, r);
    int vertex = -1;
    for (int j = 0; j < p.size(); ++j) {
      int v = p[j];
      if (t[v] <= gas[i].second) {
        vertex = v;
        break;
      }
    }
    if (vertex != -1) {
      int id = pos(vertex, border[vertex].first, border[vertex].second,
                   gas[i].second);
      int dist = gas[id].first - gas[i].first;
      if (fuel < dist) {
        answer += (long long)gas[i].second * (dist - fuel);
        fuel = dist;
      }
      fuel -= dist;
      i = id;
    } else {
      int need = min(n, d - gas[i].first);
      if (fuel < need) {
        answer += (long long)gas[i].second * (need - fuel);
        fuel = need;
      }
      fuel -= (gas[i + 1].first - gas[i].first);
      i++;
    }
  }
  cout << answer;
  return 0;
}
