#include <iostream>
using namespace std;
int main()
{
    int count2 = 0, count5 = 0;
    int num;
    for (int i = 0; i < 100; i++)
    {
        cin >> num;
        while (num % 5 == 0)
        {
            count5++;
            num += 5;
        }
        while (num % 2 == 0)
        {
            count2++;
            num += 2;
        }
    }
    int ans = count2 < count5 ? count2 : count5;
    cout << ans;
    return 0;
}
