#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
const int logn = 20;
const int inf = (int)1e9;
const long long mod = (int)1e9 + 7;
const long long l_inf = (long long)4e18;
const long double pi = acosl(-1.0);
const long double eps = 1e-9;
int d, n, cur, m;
pair<int, int> x[maxn];
pair<int, int> tree[4 * maxn];
void build(int v, int tl, int tr) {
  if (tr - tl == 1) {
    tree[v] = make_pair(x[tl].second, tl);
  } else {
    int tm = (tl + tr) >> 1;
    build(2 * v + 1, tl, tm);
    build(2 * v + 2, tm, tr);
    tree[v] = min(tree[2 * v + 1], tree[2 * v + 2]);
  }
}
pair<int, int> get(int v, int tl, int tr, int l, int r) {
  if (tr <= l || r <= tl) return make_pair(inf, inf);
  if (l <= tl && tr <= r) return tree[v];
  int tm = (tl + tr) >> 1;
  return min(get(2 * v + 1, tl, tm, l, r), get(2 * v + 2, tm, tr, l, r));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(15);
  cout << fixed;
  srand(566);
  cin >> d >> n >> m;
  cur = n;
  for (int i = 1; i <= m; i++) cin >> x[i].first >> x[i].second;
  sort(x, x + m + 1);
  build(0, 0, m + 1);
  int id = 0;
  long long cost = 0;
  while (true) {
    int l = id, r = m;
    while (l != r) {
      int mid = (l + r) >> 1;
      if (x[id].first + n >= x[mid + 1].first) {
        l = mid + 1;
      } else {
        r = mid;
      }
    }
    if (id < m && l == id) {
      cout << -1;
      exit(0);
    }
    if (x[id].first + cur >= d) {
      cout << cost;
      exit(0);
    }
    if (id == m) {
      if (x[id].first + n >= d) {
        cost += (d - x[id].first - cur) * 1ll * x[id].second;
        cout << cost;
        exit(0);
      }
      cout << -1;
      exit(0);
    }
    pair<int, int> mn = get(0, 0, m + 1, id + 1, l + 1);
    if (mn.first >= x[id].second) {
      if (x[id].first + n >= d) {
        cost += (d - x[id].first - cur) * 1ll * x[id].second;
        cout << cost;
        exit(0);
      }
      cost += x[id].second * 1ll * (n - cur);
      cur = n - (x[mn.second].first - x[id].first);
      id = mn.second;
    } else {
      int _id = id;
      while (x[_id].second >= x[id].second) _id++;
      if (x[id].first + cur >= x[_id].first) {
        cur -= x[_id].first - x[id].first;
        id = _id;
      } else {
        cost += (x[_id].first - x[id].first - cur) * 1ll * x[id].second;
        cur = 0;
        id = _id;
      }
    }
  }
  return 0;
}
