#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
long long power(long long x, long long y) {
  long long t = 1;
  while (y > 0) {
    if (y % 2)
      y -= 1, t = t * x % mod;
    else
      y /= 2, x = x * x % mod;
  }
  return t;
}
int n, d;
pair<int, int> seg[N * 3];
pair<int, int> arr[N];
void make(int C, int S, int E) {
  if (S == E) {
    seg[C] = make_pair(arr[S].second, -S);
    return;
  }
  int m = (S + E) / 2;
  make(C * 2, S, m);
  make(C * 2 + 1, m + 1, E);
  seg[C] = min(seg[C * 2], seg[C * 2 + 1]);
}
pair<int, int> query(int C, int S, int E, int s, int e) {
  if (s > E || e < S) return make_pair(mod, mod);
  if (s <= S && E <= e) return seg[C];
  int m = (S + E) / 2;
  return min(query(C * 2, S, m, s, e), query(C * 2 + 1, m + 1, E, s, e));
}
vector<pair<int, int> > les;
int nx[N];
int main() {
  int m;
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &arr[i].first, &arr[i].second);
  }
  arr[m++] = make_pair(0, 100);
  arr[m++] = make_pair(d, 0);
  sort(arr, arr + m);
  make(1, 0, m - 1);
  les.push_back(make_pair(0, m - 1));
  for (int i = m - 2; i >= 0; i--) {
    int x = lower_bound(les.begin(), les.end(), make_pair(arr[i].second, mod)) -
            les.begin();
    x--;
    nx[i] = les[x].second;
    while (les.back().first >= arr[i].second) les.pop_back();
    les.push_back(make_pair(arr[i].second, i));
  }
  int tot = n, cur = 0;
  long long ans = 0;
  while (cur < m - 1) {
    int x = lower_bound(arr, arr + m, make_pair(arr[cur].first + n, mod)) - arr;
    x--;
    if (x >= nx[cur]) {
      tot -= arr[nx[cur]].first - arr[cur].first;
      if (tot < 0) ans += -tot * 1ll * arr[cur].second, tot = 0;
      cur = nx[cur];
    } else {
      if (x <= cur) {
        ans = -1;
        break;
      }
      if (x == m - 1) break;
      pair<int, int> y = query(1, 0, m - 1, cur + 1, x);
      ans += (n - tot) * 1ll * arr[cur].second;
      tot = n;
      int nx = -y.second;
      tot -= arr[nx].first - arr[cur].first;
      cur = nx;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
