#include #include int main (void) { size_t cap = 0; char *buf = NULL; unsigned groups[512] = {0}; for (int i = 0; 0 < getline(&buf, &cap, stdin);) { if (buf[0] == '\n') { i++; continue; } for (char *ch = buf; *ch && *ch != '\n'; ++ch) { groups[i] |= 1 << (*ch - 'a'); } } int sum = 0; for (int i = 0; i < 512; ++i) { sum += __builtin_popcount(groups[i]); } printf("%d\n", sum); }