#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int inf = 1791791791;
pair<int, int> seg[4 * N];
pair<int, int> info[N];
pair<int, int> update(int root, int ll, int rl, int l, int r, int val) {
  if (r < ll || l > rl) return seg[root];
  if (ll >= l && rl <= r) {
    return seg[root] = make_pair(val, -l);
  }
  return seg[root] =
             min(update(2 * root + 1, ll, (ll + rl) / 2, l, r, val),
                 update(2 * root + 2, (ll + rl) / 2 + 1, rl, l, r, val));
}
pair<int, int> query(int root, int ll, int rl, int l, int r) {
  if (r < ll || l > rl) return make_pair(inf, inf);
  if (ll >= l && rl <= r) return seg[root];
  return min(query(2 * root + 1, ll, (ll + rl) / 2, l, r),
             query(2 * root + 2, (ll + rl) / 2 + 1, rl, l, r));
}
int main() {
  int d, n, m;
  scanf("%d %d %d", &d, &n, &m);
  int begin = 0;
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    info[i] = make_pair(a, b);
  }
  sort(info, info + m);
  info[m] = make_pair(d, 0);
  for (int i = 0; i < m; i++) {
    update(0, 0, m - 1, i, i, info[i].second);
  }
  int t = n;
  int pos = 0;
  long long resp = 0;
  for (int end = 0; end <= m; end++) {
    if (pos + t >= d) break;
    if (pos + t >= info[end].first)
      continue;
    else {
      if (end == begin) {
        printf("-1\n");
        return 0;
      } else {
        int need = info[end].first - pos - t;
        while (need) {
          if (begin == end) {
            printf("-1\n");
            return 0;
          }
          pair<int, int> cheap = query(0, 0, m - 1, begin, end - 1);
          cheap.second *= -1;
          begin = cheap.second;
          t -= info[begin].first - pos;
          pos = info[begin].first;
          int can = min(need, n - t);
          need -= can;
          t += can;
          resp += (long long)can * (long long)cheap.first;
          if (need != 0) begin++;
        }
      }
    }
  }
  printf("%lld\n", resp);
  return 0;
}
