#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MMAX = 200005;
const int LMAX = 19;
int d, n, m;
long long sol;
int lg[MMAX], rmq[LMAX][MMAX], mlc[LMAX][MMAX];
pair<int, int> v[MMAX];
void build() {
  for (int i = 2; i <= m; i++) lg[i] = lg[i / 2] + 1;
  for (int i = 1; i <= m; i++) {
    rmq[0][i] = v[i].second;
    mlc[0][i] = i;
  }
  for (int i = 1, p = 2; p <= m; i++, p *= 2)
    for (int j = 1; j <= m; j++) {
      if (rmq[i - 1][j] <= rmq[i - 1][j + p / 2]) {
        rmq[i][j] = rmq[i - 1][j];
        mlc[i][j] = mlc[i - 1][j];
      } else {
        rmq[i][j] = rmq[i - 1][j + p / 2];
        mlc[i][j] = mlc[i - 1][j + p / 2];
      }
    }
}
pair<int, int> get(int x, int y) {
  int dif = y - x + 1;
  int l = lg[dif];
  if (rmq[l][x] <= rmq[l][y - (1 << l) + 1])
    return make_pair(rmq[l][x], mlc[l][x]);
  else
    return make_pair(rmq[l][y - (1 << l) + 1], mlc[l][y - (1 << l) + 1]);
}
pair<int, int> howFar(int pos, int tank) {
  int l = pos + 1;
  int r = m;
  int where = -1;
  while (l <= r) {
    int mi = (l + r) / 2;
    if (v[mi].first - v[pos].first <= tank) {
      where = mi;
      l = mi + 1;
    } else
      r = mi - 1;
  }
  if (where == -1) return make_pair(INF, INF);
  return get(pos + 1, where);
}
void go(int pos, int tank) {
  if (get(pos, m).first == v[pos].second && d - v[pos].first <= n) {
    int howMuch = max(0, d - v[pos].first - tank);
    sol += 1LL * howMuch * v[pos].second;
    return;
  }
  int l = 0;
  int r = n - tank;
  int howMuch = -1;
  while (l <= r) {
    int mi = (l + r) / 2;
    if (howFar(pos, mi + tank).first <= v[pos].second) {
      howMuch = mi;
      r = mi - 1;
    } else
      l = mi + 1;
  }
  if (howMuch == -1) {
    pair<int, int> p = howFar(pos, n);
    int best = p.first;
    if (best == INF) {
      sol = -1;
      return;
    }
    int where = p.second;
    sol += 1LL * (n - tank) * v[pos].second;
    go(where, n - (v[where].first - v[pos].first));
    return;
  }
  sol += 1LL * howMuch * v[pos].second;
  pair<int, int> p = howFar(pos, howMuch + tank);
  int where = p.second;
  go(where, tank + howMuch - (v[where].first - v[pos].first));
}
int main() {
  cin.sync_with_stdio(false);
  cin >> d >> n >> m;
  for (int i = 1; i <= m; i++) cin >> v[i].first >> v[i].second;
  v[0].second = INF - 1;
  sort(v + 1, v + m + 1);
  build();
  go(0, n);
  cout << sol;
  return 0;
}
