import java.util.Scanner;
public class Main{
static int N = 200010;
static int prew[] = new int[N];
static int prev[] = new int[N];
static int pren[] = new int[N];
static int w[] = new int[N];
static int v[] = new int[N];
static int l[] = new int[N];
static int r[] = new int[N];
static int n,m,s,sum;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
m = sc.nextInt();
s = sc.nextInt();
int min = Integer.MAX_VALUE,max = -1;
for(int i = 1;i <= n;i++){
w[i] = sc.nextInt();
v[i] = sc.nextInt();
min = Math.min(min,w[i]);
max = Math.max(max,w[i]);
}
for(int i = 1;i <= m;i++){
l[i] = sc.nextInt();
r[i] = sc.nextInt();
}
int res = Integer.MAX_VALUE;
int left = min - 1,right = max + 2;
while(left+1 != right){
int mid = (left + right) / 2;
if(check(mid)) left = mid;
else right = mid;
if(sum < res) res = sum;
}
System.out.println(res);
}
public static boolean check(int x){
int Y = 0;
int sum = 0;
for(int i = 1;i <= n;i++){
if(w[i] >= x){
pren[i] = pren[i - 1] + 1;
prev[i] = prev[i - 1] + v[i];
}
else{
pren[i] = pren[i - 1];
prev[i] = prev[i - 1];
}
}
for(int i = 1;i <= m;i++){
Y += (pren[r[i]] - pren[l[i] - 1]) * (prev[r[i]] - prev[l[i] - 1]);
}
sum = Math.abs(Y - s);
if(Y > s) return true;
else return false;
}
}