#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x;
  int p;
} stanica;
void merge(stanica a[], int low, int mid, int high);
void MergeSort(stanica a[], int low, int high);
int jeftinija(stanica s[], int t, int n, int m, int* povoljna);
int main() {
  int d, n, m;
  cin >> d >> n >> m;
  stanica s[200000];
  for (int i = 0; i < m; i++) cin >> s[i].x >> s[i].p;
  MergeSort(s, 0, m - 1);
  unsigned long long int c = 0;
  int t = 0;
  int trez = n;
  int pov;
  if (s[0].x > n) {
    cout << "-1" << endl;
    return 0;
  }
  trez -= s[0].x;
  while (1) {
    if (d - s[t].x <= trez) {
      cout << c << endl;
      return 0;
    }
    int jeft = jeftinija(s, t, n, m, &pov);
    if (jeft == -1) {
      if (pov == -1) {
        if (d - s[t].x > n) {
          cout << "-1\n";
          return 0;
        } else {
          if (trez < d - s[t].x)
            c += (unsigned long long)(d - s[t].x - trez) *
                 (unsigned long long)s[t].p;
          cout << c << endl;
          return 0;
        }
      } else {
        int dopuna = min(d - s[t].x - trez, n - trez);
        c += (unsigned long long)dopuna * (unsigned long long)s[t].p;
        trez += dopuna;
        trez -= s[pov].x - s[t].x;
        t = pov;
      }
    } else {
      if (trez < s[jeft].x - s[t].x) {
        c += (unsigned long long)(s[jeft].x - s[t].x - trez) *
             (unsigned long long)s[t].p;
        trez = 0;
      } else
        trez -= s[jeft].x - s[t].x;
      t = jeft;
    }
  }
  return 0;
}
void merge(stanica a[], int low, int mid, int high) {
  stanica* pom = (stanica*)malloc((high - low + 1) * sizeof(stanica));
  int i = low;
  int j = mid + 1;
  int k = 0;
  while (i <= mid && j <= high) {
    if (a[i].x <= a[j].x)
      pom[k++] = a[i++];
    else
      pom[k++] = a[j++];
  }
  while (i <= mid) pom[k++] = a[i++];
  while (j <= high) pom[k++] = a[j++];
  for (i = 0; i < high - low + 1; i++) a[low + i] = pom[i];
  free(pom);
}
void MergeSort(stanica a[], int low, int high) {
  if (low < high) {
    int mid = (low + high) / 2;
    MergeSort(a, low, mid);
    MergeSort(a, mid + 1, high);
    merge(a, low, mid, high);
  }
}
int jeftinija(stanica s[], int t, int n, int m, int* povoljna) {
  int i = t + 1;
  if (i < m && s[i].x - s[t].x <= n)
    *povoljna = i;
  else {
    *povoljna = -1;
    return -1;
  }
  while (i < m && s[i].x - s[t].x <= n) {
    if (s[i].p <= s[t].p) return i;
    if (s[i].p < s[*povoljna].p) *povoljna = i;
    i++;
  }
  return -1;
}
