#include using namespace std; int n , i , val , y , x; set < int > my , aux; set < int > :: iterator it; vector < int > sol; int main() { //freopen("input" , "r" , stdin); //freopen("output" , "w" , stdout); cin >> n; for (i = 1 ; i <= n ; ++i) { cin >> val; my.insert(val); } while (my.size()) { x = *my.begin(); my.erase(my.begin()); sol.push_back(x); if (x == 0) continue; aux.clear(); for (it = my.begin() ; it != my.end() ; ++it) { y = *it; if ((y & x) == x) aux.insert(y - x); else aux.insert(y); } my = aux; } cout << sol.size() << '\n'; //for (i = 0 ; i < sol.size() ; ++i) cout << sol[i] << " "; return 0; }