{
TASK: food
LANG:PASCAL
}

type
 pp = record
       p : LongInt;
       f : Byte;
       pn : array[1..10] of Byte;
      end;

var
 n, i : Byte;
 m, j : Byte;
 k : Byte;
 f : array[1..75] of LongInt;
 p : array[1..75] of pp;
 mo : array[1..75] of LongInt;
 s, fn : LongInt;
 pu : array[1..75] of Byte;
 hu : array[1..75] of Byte;

function find(x : Byte): LongInt;
var r1, r2 : LongInt;
 i : Byte;
 sum : LongInt;
 hu1 : array[1..75] of Byte;
Begin
 if x<1 then
 Begin
  find := s;
  exit;
 end;

 pu[x] := 0;
 r1 := find(x-1);

 fillchar(hu1, sizeof(hu1), 0); sum := s;
 for i := 1 to p[x].f do
 Begin
  if hu[p[x].pn[i]]=0 then
  Begin
   dec(s, f[p[x].pn[i]]);
   hu1[p[x].pn[i]] := 1;
   hu[p[x].pn[i]] := 1;
  end;
 end;

 pu[x] := 1;
 inc(s, p[x].p);
 r2 := find(x-1);

  s := sum;
 for i := 1 to n do if hu1[i]=1 then hu[i] := 0;

 if r1>r2 then find := r1 else find := r2;
end;

Begin
 readln(n, m);
 for i := 1 to n do readln(f[i]);

 for j := 1 to m do
 Begin
  read(p[j].p, p[j].f);
  for k := 1 to p[j].f do read(p[j].pn[k]);
  readln;
 end;

 fillchar(pu, sizeof(pu), 0);
 fillchar(hu, sizeof(hu), 0);
 s := 0;
 fn := find(m);
 if fn < 0 then fn := 0;
 writeln(fn);
end.