#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
const int INF = 1000000000;
int two[MAXN];
int st[20][MAXN];
int d[MAXN], p[MAXN];
void build_st(int *v, int n) {
  for (int i = 0; i < n; i++) st[0][i] = v[i];
  for (int i = 1; (1 << i) <= n; i++) {
    for (int j = 0; j + (1 << i) <= n; j++) {
      st[i][j] = min(st[i - 1][j], st[i - 1][j + (1 << (i - 1))]);
    }
  }
}
int rmq(int x, int y) {
  int k = two[y - x + 1];
  return min(st[k][x], st[k][y - (1 << k) + 1]);
}
int abastece(int x, int t, int n, int m) {
  int lo = x + 1, hi = m + 1;
  while (lo < hi) {
    int mid = (lo + hi) >> 1;
    if (rmq(x + 1, mid) > p[x]) {
      lo = mid + 1;
    } else {
      hi = mid;
    }
  }
  int cost = d[lo] - d[x];
  cost -= t;
  return min(n - t, max(0, cost));
}
int main() {
  int end, n, m;
  two[0] = -1;
  for (int i = 1; i < MAXN; i++)
    two[i] = two[i - 1] + ((i & (-i)) == i ? 1 : 0);
  while (scanf(" %d %d %d", &end, &n, &m) != EOF) {
    vector<pair<int, int> > pares;
    for (int i = 0; i < m; i++) {
      int x, y;
      scanf(" %d %d", &x, &y);
      pares.push_back(make_pair(x, y));
    }
    sort(pares.begin(), pares.end());
    for (int i = 0; i < (int)pares.size(); i++)
      d[i] = pares[i].first, p[i] = pares[i].second;
    d[m] = end, p[m] = 0;
    build_st(p, m + 1);
    int tank = n;
    long long total_cost = 0;
    for (int i = 0; i < m + 1; i++) {
      tank -= d[i];
      if (i) tank += d[i - 1];
      if (tank < 0) {
        total_cost = -1;
        break;
      } else {
        if (i == m) break;
        int tmp = abastece(i, tank, n, m);
        tank += tmp;
        total_cost += 1LL * tmp * p[i];
      }
    }
    cout << total_cost << endl;
  }
}
