#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vb; typedef vector vi; typedef vector vvb; typedef vector vvi; typedef pair pii; const int INF=1<<29; const double EPS=1e-9; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; int main(int argc, char const *argv[]) { int N; cin >> N; std::vector > m(N, vector(60, 0LL)); for (int i = 0; i < N; ++i) { long long int temp; cin >> temp; for (int j = 0; j < 61; ++j) { m[i][j] = ((long long int)temp >> j & 1); } } set se; for (int j = 0; j < 61; ++j) { string target = ""; for (int i = 0; i < N; ++i) { string s; if (m[i][j] == 0) { s = "0"; } else { s = "1"; } target += s; } //cout << target << endl; se.insert(target); } long long int ans = 1LL << (se.size() - 1); cout << ans << endl; return 0; }