#include <bits/stdc++.h>
using namespace std;
long long dp[305][305], f[305][305];
int M, N, K, xc, yc, wc;
long long ans;
vector<pair<int, int> > a[305];
void mplus(int x, int y, long long num) {
  while (y <= N) {
    f[x][y] = min(f[x][y], num);
    y += y & (-y);
  }
}
long long getmin(int x, int l, int r) {
  long long ans = (long long)2139062143 * 2139062143;
  if (l == 0) ans = min(ans, dp[x][0]), ++l;
  while (r >= l) {
    if (r - (r & (-r)) >= l)
      ans = min(ans, f[x][r]), r -= r & (-r);
    else
      ans = min(ans, dp[r][x]), r--;
  }
  return ans;
}
int main() {
  scanf("%d %d %d", &N, &M, &K);
  for (int i = 1; i <= M; i++) {
    scanf("%d %d %d", &xc, &yc, &wc);
    a[yc].push_back(make_pair(xc, wc));
  }
  for (int i = 0; i <= N; i++)
    for (int j = 0; j <= N; j++)
      dp[i][j] = (long long)2139062143 * 2139062143,
      f[i][j] = (long long)2139062143 * 2139062143;
  dp[0][0] = 0;
  for (int i = 1; i <= N; i++)
    for (int j = 0; j <= N - K; j++) {
      if (j > 0) dp[i][j] = dp[i - 1][j - 1];
      for (int k = 0; k < a[i].size(); k++)
        dp[i][j] =
            min(dp[i][j], getmin(j, a[i][k].first - 1, i - 1) + a[i][k].second);
      mplus(j, i, dp[i][j]);
    }
  ans = (long long)2139062143 * 2139062143;
  for (int j = 0; j <= N - K; j++) ans = min(ans, dp[N][j]);
  if (ans == (long long)2139062143 * 2139062143) ans = -1;
  cout << ans << endl;
  return 0;
}
