Pagini recente » Cod sursa (job #2038906) | Cod sursa (job #920331) | Cod sursa (job #983558) | Cod sursa (job #3179828) | Cod sursa (job #1942741)
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i <= b; i++)
#define ROF(i,a,b) for (int i = a; i >= b; i--)
#define FOREACH(it,x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define all(x) (x).begin(),(x).end()
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define SZ(x) ((int)(x).size())
class Parser {
public:
Parser() : cursor(0) {
fread(buff,1,SIZE,stdin);
}
long long nextLong() {
long long sgn = 1, ret = 0;
while (isdigit(buff[cursor]) == 0 && buff[cursor] != '-') advance();
if (buff[cursor] == '-') advance(), sgn = -1;
while (isdigit(buff[cursor])) ret = ret * 10 + buff[cursor] - '0', advance();
return ret * sgn;
}
private:
static const int SIZE = 1<<17;
int cursor;
char buff[SIZE];
inline void advance() {
cursor++;
if (cursor == SIZE) {
cursor = 0;
fread(buff,1,SIZE,stdin);
}
}
};
set<ll> S;
inline ll sm(ll x) { /// to reduce unordered_set worst case
while (!(x&1LL)) x>>=1LL;
return x;
}
int main()
{
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
Parser in;
FOR(i,1,276997) S.insert(sm(in.nextLong()));
ll n = in.nextLong(), Sol = 0;
while (n--) {
ll x = sm(in.nextLong());
if (S.find(x) != S.end()) Sol++;
}
printf("%lld",Sol);
}