#include <bits/stdc++.h>
using namespace std;
pair<long long int, long long int> a[200005];
long long int table[200005][22], m, nxt[200005];
void build() {
  for (long long int i = 0; i <= m; i++) table[i][0] = a[i].second;
  for (long long int j = 1; j <= 21; j++) {
    for (long long int i = 0; i <= m - (1 << j) + 1; i++)
      table[i][j] = min(table[i][j - 1], table[i + (1 << (j - 1))][j - 1]);
  }
}
inline long long int query(long long int l, long long int r) {
  if (l > r) return 2000000000000000000;
  long long int len = r - l + 1;
  long long int k = log2(len);
  return min(table[l][k], table[r + 1 - (1 << k)][k]);
}
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, d, will_take, cur_gas, ans = 0, lo, mid, hi;
  cin >> d >> n >> m;
  for (i = 1; i <= m; i++) cin >> a[i].first >> a[i].second;
  a[0] = {0, 2000000000000000000};
  a[m + 1] = {d, 0};
  m++;
  sort(a, a + m);
  build();
  for (i = m - 1; i >= 0; i--) {
    lo = i;
    hi = m;
    while (hi - lo > 1) {
      mid = (lo + hi) / 2;
      if (query(i + 1, mid) <= a[i].second)
        hi = mid;
      else
        lo = mid;
    }
    nxt[i] = hi;
  }
  cur_gas = n;
  for (i = 0; i < m; i++) {
    will_take = max(0LL, min(n, a[nxt[i]].first - a[i].first) - cur_gas);
    ans += will_take * a[i].second;
    cur_gas += will_take;
    cur_gas -= (a[i + 1].first - a[i].first);
    if (cur_gas < 0) {
      cout << "-1";
      return 0;
    }
  }
  cout << ans;
  return 0;
}
