using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;

struct fish
{
    public long x, a;
    public fish(long[] g)
    {
        x = g[0];
        a = g[1];
    }
}

struct shop
{
    public long y, b, c;
    public int sort;
    public shop(long[] g)
    {
        y = g[0];
        b = g[1];
        c = g[2];
        sort = Convert.ToInt32(c);
    }
}

class Program
{
    static int cmp(shop a, shop b)
    {
        return a.sort - b.sort;
    }
    static void Main()
    {
        StreamReader read = new StreamReader(new FileStream("fisher.in", FileMode.Open));
        StreamWriter write = new StreamWriter(new FileStream("fisher.out", FileMode.Create));
        int[] g = read.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        int n = g[0], m = g[1], p = g[2];
        fish[] f = new fish[n];
        shop[] s = new shop[m];
        for (int i = 0; i < n; i ++)
            f[i] = new fish(read.ReadLine().Split().Select(x => long.Parse(x)).ToArray());
        for (int i = 0; i < m; i++)
            s[i] = new shop(read.ReadLine().Split().Select(x => long.Parse(x)).ToArray());
        long sum = 0, ans = 0;
        for (int i = 0; i < n; i++)
            sum += f[i].a;
        Array.Sort(s, cmp);
        for (int i = m - 1; i > -1; i --)
        {
            if (sum > s[i].b)
            {
                sum -= s[i].b;
                ans += s[i].b * s[i].c;
            }
            else
            {
                ans += sum * s[i].c;
                break;
            }
        }
        write.WriteLine(ans);
        read.Close();
        write.Close();
    }
}