#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f;
const double inf = 1e18;
const long long mod = 1e9 + 7;
const unsigned long long mx = 133333331;
inline void RI(int &x) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0';
}
struct Node {
  int x, p;
  bool operator<(const Node &a) const { return p < a.p; }
} node[200005];
int vis[200005];
int dis[200005];
bool cmp(Node a, Node b) { return a.x < b.x; }
int main() {
  int d, n, m;
  while (~scanf("%d%d%d", &d, &n, &m)) {
    memset(vis, -1, sizeof(vis));
    for (int i = 1; i <= m; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      node[i] = (Node){a, b};
    }
    sort(node + 1, node + m + 1, cmp);
    int flag = 0;
    node[0] = (Node){0, 0};
    node[m + 1] = (Node){d, 0};
    for (int i = 0; i <= m; i++) {
      if (node[i].x + n < node[i + 1].x) {
        flag = 1;
        break;
      }
    }
    if (flag) {
      printf("-1\n");
      continue;
    }
    set<Node> s;
    s.insert((Node){n, 0});
    long long cost = 0;
    for (int i = 1; i <= m + 1; i++) {
      int dis = node[i].x - node[i - 1].x;
      int cnt = dis;
      for (set<Node>::iterator it = s.begin(); it != s.end();) {
        if (it->x <= dis) {
          cost += (long long)(it->p) * (it->x);
          dis -= it->x;
          s.erase(it++);
        } else {
          cost += (long long)dis * (it->p);
          Node k = (Node){it->x - dis, it->p};
          s.erase(it);
          s.insert(k);
          break;
        }
      }
      while (1) {
        set<Node>::iterator it = s.lower_bound((Node){0, node[i].p});
        if (it == s.end()) break;
        cnt += it->x;
        s.erase(it);
      }
      if (cnt) s.insert((Node){cnt, node[i].p});
    }
    cout << cost << endl;
  }
  return 0;
}
