#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iomanip>
#include<ctime>
#include<queue>
#include<stack>
#define rg register
#define lst long long
#define N 1050
#define M 10050
using namespace std; int n,m,k,num[N],u,v,w;
int down[N],up[N],ans;
int arrive[N],peo[N];
int val,idx; inline int read()
{
rg int s=,m=;rg char ch=getchar();
while(ch!='-'&&(ch<''||ch>''))ch=getchar();
if(ch=='-')m=-,ch=getchar();
while(ch>=''&&ch<='')s=(s<<)+(s<<)+ch-'',ch=getchar();
return s*m;
} int main()
{
// freopen("s.in","r",stdin);
n=read(),m=read(),k=read();
for(rg int i=;i<n;++i)num[i]=read();
for(rg int i=;i<=m;++i)
{
u=read(),v=read(),w=read();
ans-=u,down[w]++,up[v]=max(u,up[v]);
}
while(k--)
{
memset(peo,,sizeof(peo));
for(rg int i=;i<=n;++i)
arrive[i]=max(arrive[i-],up[i-])+num[i-];
for(rg int i=n;i>=;--i)
{
if(num[i-])
{
peo[i-]=down[i];
if(arrive[i]>up[i])
peo[i-]+=peo[i];
}
else peo[i-]=;
}
val=,idx=-;
for(rg int i=;i<=n;++i)
if(val<peo[i])val=peo[i],idx=i;
if(idx==-)break;
num[idx]--;
}
for(rg int i=;i<=n;++i)
arrive[i]=max(arrive[i-],up[i-])+num[i-];
for(rg int i=;i<=n;++i)ans+=arrive[i]*down[i];
printf("%d\n",ans);
return ;
}