#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
int n, d, m;
pair<long long, long long> tree[4 * N];
pair<long long, long long> arr[N];
void build(int pos, int l, int r) {
  if (l == r) {
    tree[pos] = {arr[l].second, l};
    return;
  }
  int mid = (l + r) / 2;
  build(pos << 1, l, mid);
  build(pos << 1 | 1, mid + 1, r);
  tree[pos] = min(tree[pos << 1], tree[pos << 1 | 1]);
}
pair<long long, long long> get(int pos, int l, int r, int qLow, int qHigh) {
  if (l > qHigh || r < qLow) return {1e9, 1e9};
  if (l >= qLow && r <= qHigh) return tree[pos];
  int mid = (l + r) / 2;
  return min(get(pos << 1, l, mid, qLow, qHigh),
             get(pos << 1 | 1, mid + 1, r, qLow, qHigh));
}
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    arr[i] = {x, y};
  }
  arr[++m] = {d, 0};
  sort(arr + 1, arr + m);
  build(1, 1, m);
  long long p = 0;
  int i = 1;
  int tank = n - arr[1].first;
  while (i < m) {
    if (tank < 0) return printf("-1"), 0;
    int lft = i + 1, right = m - 1, ans = m;
    while (lft <= right) {
      int mid = (lft + right) / 2;
      pair<long long, long long> curr_min = get(1, 1, m, i + 1, mid);
      if (curr_min.first <= arr[i].second) {
        ans = curr_min.second;
        right = mid - 1;
      } else {
        lft = mid + 1;
      }
    }
    int target = min(1LL * n, arr[ans].first - arr[i].first);
    int buy = 0;
    if (target > tank) buy = target - tank;
    p += buy * arr[i].second;
    tank += buy - arr[i + 1].first + arr[i].first;
    i++;
  }
  if (tank < 0)
    printf("-1");
  else
    printf("%lld", p);
  return 0;
}
