#include <bits/stdc++.h>
using namespace std;
int dist, cur, n, nxt[200005];
long long ret = 0;
stack<int> stk;
pair<int, int> a[200005];
int main() {
  scanf("%d %d %d", &dist, &cur, &n);
  int t = cur;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i].first, &a[i].second);
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    while (!stk.empty() && a[stk.top()].second >= a[i].second) {
      stk.pop();
    }
    if (!stk.empty()) {
      nxt[i] = stk.top();
    } else {
      nxt[i] = -1;
    }
    stk.push(i);
  }
  cur -= a[0].first;
  for (int i = 0; i < n; i++) {
    if (cur < 0) {
      puts("-1");
      exit(0);
    }
    int needy = min(t, (nxt[i] == -1 ? dist : a[nxt[i]].first) - a[i].first);
    if (needy > cur) {
      ret += 1LL * (needy - cur) * a[i].second;
      cur = needy;
    }
    cur -= (i == n - 1 ? dist : a[i + 1].first) - a[i].first;
  }
  if (cur < 0) {
    puts("-1");
  } else {
    printf("%I64d\n", ret);
  }
  return 0;
}
