#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int maxn = 1e6 + 5;   long long int power(long long int base, long long int exp) {     long long int res = 1;     while (exp) {       if (exp % 2) res *= base;       base *= base;       res %= mod;       base %= mod;       exp /= 2;     }     return res;   }   long long int n, m, k, l[maxn], r[maxn], dp[350][350], adj[350][350], c[maxn];   long long int go(long long int idx, long long int k) {     if (k <= 0) return 0;     if (idx >= n + 1) return 1e16;     long long int &ret = dp[idx][k];     if (ret != -1) return ret;     ret = go(idx + 1, k);     for (long long int i = idx; i <= min(idx + k, n); i++) {       ret = min(ret, go(i + 1, k - (i - idx + 1)) + adj[idx][i]);     }     return ret;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n >> m >> k;     for (long long int i = 1; i <= n; i++)       for (long long int j = i; j <= n; j++) adj[i][j] = 1e15;     for (long long int i = 1; i <= m; i++) {       cin >> l[i] >> r[i] >> c[i];       adj[l[i]][r[i]] = min(adj[l[i]][r[i]], c[i]);     }     for (long long int i = 1; i <= n; i++) {       for (long long int j = 1; j <= n; j++) {         if (i < j) break;         for (long long int k = j; k <= n; k++) {           adj[j][k] = min(adj[j][k], adj[j][i] + adj[i][k]);         }       }     }     memset(dp, -1, sizeof(dp));     long long int ans = go(1, k);     if (ans > 1e12) ans = -1;     cout << ans;     return 0;   }   