#include "bits/stdc++.h"

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
ll inf = 1e18;


ll N, M;
int main() {
	while (cin >> N >> M && N > 0) {
		ll sum_max[10101] = {};
		ll sum_min[10101] = {};
		ll S[1010] = {};
		vector<ll> C[1010];
		REP(i,0,M){
			ll k;
			cin >> S[i] >> k;
			REP(j,0,k){
				ll c;
				cin >> c;
				C[i].push_back(c-1);
			}
		}
		REP(i,0,M){
			if(C[i].size() == 1){
				sum_max[C[i][0]] += S[i];
				sum_min[C[i][0]] += S[i];
			}else{
				REP(j,0,C[i].size()){
					sum_max[C[i][j]] += S[i];
				}
			};
		}
		ll ans = 0;
		REP(i,0,N){
			REP(j,0,N){
				if(i==j) continue;
				ans = max(ans, sum_max[i] - sum_min[j]+1);
			}

		}
		p(ans);
	}

	return 0;
}
