#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
  bool operator<(const node &_) const { return x < _.x; }
};
const int MAXN = 200000;
const int INF = 1 << 30;
int d, n, m;
node nodes[MAXN + 10];
int nx[MAXN + 10];
stack<int> S;
int main(void) {
  scanf("%d%d%d", &d, &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%d", &nodes[i].x, &nodes[i].y);
  m++;
  nodes[m].x = d;
  nodes[m].y = 0;
  nodes[0].x = 0;
  nodes[0].y = INF;
  sort(nodes, nodes + 1 + m);
  for (int i = 0; i <= m; i++) {
    while (!S.empty() && nodes[i].y < nodes[S.top()].y) {
      nx[S.top()] = i;
      S.pop();
    }
    S.push(i);
  }
  int pos = 0, now = n;
  long long cost = 0;
  while (nodes[pos].x != d) {
    int sd = min(n, nodes[nx[pos]].x - nodes[pos].x);
    if (now < sd) {
      cost += (long long)(sd - now) * (long long)nodes[pos].y;
      now = sd;
    }
    now -= nodes[pos + 1].x - nodes[pos].x;
    if (now < 0) {
      printf("-1\n");
      return 0;
    }
    pos++;
  }
  cout << cost << endl;
  return 0;
}
