#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int N = 410;   int cnt[N];   int temp[N];   long long cost[N][N];   long long dp[N][N];   long long n, m, k;   const long long INF = (1LL) << 60;   vector<int> v[200];   int main() {     while (cin >> n >> m >> k) {       memset(dp, 0, sizeof(dp));       for (int i = 0; i < N; i++)         for (int j = 0; j < N; j++) {           cost[i][j] = INF;           dp[i][j] = INF;         }       for (long long i = 0; i < m; i++) {         long long l, r, c;         cin >> l >> r >> c;         cost[l - 1][r] = min(cost[l - 1][r], c);       }       for (long long i = 0; i <= n; i++)         for (long long j = n; j >= i; j--) {           cost[i][j - 1] = min(cost[i][j - 1], cost[i][j]);           cost[i + 1][j] = min(cost[i + 1][j], cost[i][j]);         }       dp[0][0] = 0;       for (long long i = 1; i <= n; i++) {         for (long long j = 0; j <= i; j++) {           dp[i][j] = dp[i - 1][j];           for (long long k = 0; k < i; k++) {             if (j - i + k >= 0)               dp[i][j] = min(dp[i][j], dp[k][j - i + k] + cost[k][i]);           }         }       }       long long ans = INF;       for (long long i = k; i <= n; i++) ans = min(ans, dp[n][i]);       if (ans == INF)         cout << -1 << endl;       else         cout << ans << endl;     }     return 0;   }   