#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2E5 + 10;
int d, n, m;
pair<int, int> a[MAXN];
int main() {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; ++i) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a + 1, a + m + 1);
  int l = 0, r = 0;
  long long ans = 0;
  a[0] = pair<int, int>(n, 0);
  a[m + 1].first = d;
  for (int i = m; i > 0; --i) a[i + 1].first -= a[i].first;
  for (int i = 1; i <= m + 1; ++i) {
    if (a[i].first > n) {
      ans = -1;
      break;
    }
    int t = a[i].first;
    for (; a[l].first <= t; ++l) {
      t -= a[l].first;
      ans += a[l].first * (long long)a[l].second;
    }
    a[l].first -= t;
    ans += t * (long long)a[l].second;
    for (; l <= r && a[r].second > a[i].second; --r) a[i].first += a[r].first;
    a[++r] = a[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
