#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 5;
struct Point {
  int x, p;
  Point() {}
  Point(int _x, int _p) {
    x = _x;
    p = _p;
  }
};
int d, n, m;
Point g[maxN];
int dp[maxN], NEXT[maxN];
stack<int> st;
bool cmp(Point a, Point b) { return a.x < b.x; }
int main() {
  scanf("%d %d %d", &d, &n, &m);
  for (int i = 1; i <= m; ++i) scanf("%d %d", &g[i].x, &g[i].p);
  g[0] = Point(0, 0);
  g[m + 1] = Point(d, 0);
  sort(g, g + m + 1, cmp);
  st.push(m + 1);
  for (int i = m; i >= 1; --i) {
    while (g[st.top()].p > g[i].p) st.pop();
    NEXT[i] = st.top();
    st.push(i);
  }
  long long res = 0;
  dp[0] = n;
  for (int i = 1; i <= m + 1; ++i) {
    dp[i] = dp[i - 1] - (g[i].x - g[i - 1].x);
    if (dp[i] < 0) {
      printf("-1");
      return 0;
    }
    if (i == m + 1) break;
    int dis = g[NEXT[i]].x - g[i].x;
    int need = max(0, min(dis, n) - dp[i]);
    dp[i] += need;
    res += (long long)g[i].p * need;
  }
  cout << res;
  return 0;
}
