#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int gcd(int x, int y) {
  while (y) {
    int t = x % y;
    x = y;
    y = t;
  }
  return x;
}
int q[200010], head, tail;
pair<int, int> gass[200010];
int main() {
  int len, n, m;
  scanf("%d%d%d", &len, &n, &m);
  long long ans = 0;
  for (int i = 1; i <= m; i++) scanf("%d%d", &gass[i].first, &gass[i].second);
  sort(gass + 1, gass + 1 + m);
  int nowi = 1, nowt = n;
  head = 0, tail = 0;
  for (; nowi <= m; nowi++) {
    if (gass[nowi].first > nowt) break;
    while (head < tail && gass[q[tail - 1]].second >= gass[nowi].second) tail--;
    q[tail++] = nowi;
  }
  gass[++m].first = len;
  int flag = 0;
  for (; nowi <= m; nowi++) {
    while (head < tail && gass[nowi].first - gass[q[head]].first > n) {
      int tmp = min(gass[q[head]].first + n, len);
      ans += 1LL * (tmp - nowt) * gass[q[head]].second;
      nowt = tmp;
      head++;
    }
    if (nowt == len) break;
    if (head == tail) {
      flag = 1;
      break;
    }
    ans += 1LL * (gass[nowi].first - nowt) * gass[q[head]].second;
    nowt = gass[nowi].first;
    if (nowt == len) break;
    while (head < tail && gass[q[tail - 1]].second >= gass[nowi].second) tail--;
    q[tail++] = nowi;
  }
  if (flag)
    puts("-1");
  else
    printf("%lld\n", ans);
  return 0;
}
