#include <bits/stdc++.h>
using namespace std;
long long int n;
int m;
vector<pair<int, long long int> > v;
long long int d;
deque<pair<long long int, long long int> > q;
int main() {
  scanf("%I64d%I64d%d", &d, &n, &m);
  for (int i = 0; i < m; i++) {
    long long int x;
    long long int p;
    scanf("%I64d%I64d", &x, &p);
    v.push_back(make_pair(x, p));
  }
  sort(v.begin(), v.end());
  v.push_back(make_pair(d, 114514LL));
  long long int has = n;
  long long int pre = 0;
  long long int add = 0;
  long long int ans = 0;
  for (int i = 0; i < m + 1; i++) {
    long long int moved = v[i].first - pre;
    if (has < moved) {
      long long int need = moved - has;
      while (q.size() && need > 0LL) {
        long long int can = q.front().second - add;
        if (can < 0LL) {
          return 1;
        }
        if (can == 0LL) {
          q.pop_front();
          continue;
        }
        long long int minu = min(can, need);
        need -= minu;
        add += minu;
        ans += minu * q.front().first;
        has += minu;
      }
      if (need) {
        puts("-1");
        return 0;
      }
    }
    pre = v[i].first;
    has -= moved;
    while (q.size() && q.back().first > v[i].second) {
      q.pop_back();
    }
    q.push_back(make_pair(v[i].second, n - has + add));
  }
  printf("%I64d\n", ans);
  return 0;
}
