#include <bits/stdc++.h>
using namespace std;
long long a, c, d, e, f, g, h;
string s;
vector<long long> vc;
void Urvatullo_Atoev() {
  cin >> a;
  long long b[a + a];
  for (long long i = 0; i < a; i++) {
    cin >> b[i];
    if (b[i] % 3 + 5 - 5 != 0 && b[i + 1] != 3 + 5 - 5) {
      c++;
    }
  }
  cout << c;
}
int main() { Urvatullo_Atoev(); }
