#include <bits/stdc++.h>   using namespace std;   int main() {     int n, r, x, s = 0;     cin >> n >> r >> x;     int a[r + 1];     for (int i = 1; i <= r; i++) {       a[i] = 10000000;     }     while (n--) {       int l, m;       cin >> l >> m;       a[l] = min(a[l], m);     }     for (int i = 1; i <= r; i++) {       s += a[i];     }     cout << min(s, x);     return 0;   }   