#include <bits/stdc++.h>
using namespace std;
pair<int, int> arr[200005];
int dp[200005], st[200005], tp, nxt[200005];
int main() {
  int d, lim, n;
  scanf("%d%d%d", &d, &lim, &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &arr[i].first, &arr[i].second);
  n += 2;
  arr[0].first = 0;
  arr[0].second = 0;
  arr[n - 1].first = d;
  arr[n - 1].second = 0;
  sort(arr, arr + n);
  for (int i = n - 1; i >= 0; i--) {
    while (tp && arr[st[tp - 1]].second > arr[i].second) tp--;
    if (tp) nxt[i] = st[tp - 1];
    st[tp++] = i;
  }
  dp[0] = lim;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    int delta = arr[i].first - arr[i - 1].first;
    dp[i] = dp[i - 1] - delta;
    if (dp[i] < 0) {
      printf("-1\n");
      return 0;
    }
    if (i + 1 != n) {
      int mx = min(lim, arr[nxt[i]].first - arr[i].first) - dp[i];
      dp[i] += max(mx, 0);
      ans += (long long)max(mx, 0) * arr[i].second;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
