#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, x, q; cin >> n >> x >> q; int ansx2 = 0; while (q--) { int m; cin >> m; vector a(m); rep(i, m) cin >> a[i]; { bool exi = false; rep(i, m) if (a[i] == x) exi = true; if (exi) { ansx2 += 2; continue; } } { set st; bool exi = false; rep(i, m) { if (st.contains(a[i])) exi = true; st.insert(a[i]); } if (exi) { ansx2 += 1; continue; } } } cout << ansx2 / 2 << '.' << (ansx2 % 2 * 5) << "\n"; return 0; }