#include <bits/stdc++.h>
using namespace std;
stack<pair<int, int> > q;
long long ans;
int d, n, m, nxt[200000], ct;
pair<int, int> a[200000];
int main() {
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 0; i < m; ++i) scanf("%d %d", &a[i].first, &a[i].second);
  sort(a, a + m);
  q.push(make_pair(0, d));
  for (int i = m - 1; i >= 0; --i) {
    while (a[i].second <= q.top().first) q.pop();
    nxt[i] = q.top().second;
    q.push(make_pair(a[i].second, a[i].first));
  }
  int ct = n - a[0].first;
  for (int i = 0; i < m; ++i) {
    if (i) ct -= a[i].first - a[i - 1].first;
    if (ct < 0) {
      puts("-1");
      return 0;
    }
    if (ct < nxt[i] - a[i].first) {
      ans += 1ll * min(nxt[i] - a[i].first - ct, n - ct) * a[i].second;
      ct = min(n, nxt[i] - a[i].first);
    }
  }
  if (ct - (d - a[m - 1].first) < 0)
    puts("-1");
  else
    printf("%lld\n", ans);
}
