#include <bits/stdc++.h>
using namespace std;
pair<int, int> arr[200007];
map<int, long long> mmap;
bool comp(pair<int, int> a, pair<int, int> b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
int main() {
  int n, m, d;
  cin >> d >> n >> m;
  for (int i = 1; i <= m; i++) cin >> arr[i].first >> arr[i].second;
  arr[0] = (pair<int, int>){0, 0};
  arr[m + 1] = (pair<int, int>){d, 0};
  m += 2;
  sort(arr, arr + m);
  for (int i = 1; i < m; i++)
    if (arr[i].first - arr[i - 1].first > n) {
      printf("-1\n");
      return 0;
    }
  sort(arr, arr + m, comp);
  long long ans = 0;
  mmap[0] = n;
  mmap[d] = 0;
  for (int i = 1; i < m; i++) {
    map<int, long long>::iterator it2 = mmap.lower_bound(arr[i].first),
                                  it1 = it2;
    it1--;
    int left = it1->first + it1->second, right = it2->first;
    left = max(arr[i].first, left);
    right = min(right, arr[i].first + n);
    if (right <= left) continue;
    ans += 1LL * (right - left) * arr[i].second;
    mmap[arr[i].first] = right - arr[i].first;
  }
  printf("%I64d\n", ans);
  return 0;
}
