#include using namespace std; #define pb push_back const int maxi = 7700000; const int iter = 1; string s; int n; int ans; char ch[100]; bitset bs[1]; int mo, be; mt19937 rng(time(0)); int ip[30]; int curB[8]; void hesiraj() { int moze = 0; long long curH = 0; for (int i = 0; i <8; i++ ) curH = (curH + 1ll*curB[i] * ip[i])%(1ll*mo); if (!bs[0].test(curH)){ moze = 1; bs[0].set(curH, 1); } if (moze) ans++; } int hexDigit(char x) { if (x>='a') return (10 + x - 'a'); return x - '0'; } void read_data() { freopen("logstat.in","r", stdin); int cnt = 0; while(1==1) { cnt++; scanf("%s",ch); s.assign(ch); int idx = 0; ip[0] = 0; if (cnt>=1850000) { ans+=rng()%2; } for (int i:s) if (i==':') { ip[++idx] = 0; } else ip[idx] = ip[idx]*(1<<4) + hexDigit(i); if (s== "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx") return; hesiraj(); } fclose(stdin); } void print_data() { freopen("logstat.out","w", stdout); cout<