#include <iostream>
using namespace std;
int main() {
char n;
int k=0;
while (cin >> n
)
if(n=='5') k++;
cout << k;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgljaGFyIG47CglpbnQgaz0wOwoJd2hpbGUgKGNpbiA+PiBuCgkpCQoJCWlmKG49PSc1JykgaysrOwoJY291dCA8PCBrOwoJcmV0dXJuIDA7Cn0=