( while read; do grep -oFe "$REPLY" secondfile | wc -l; done ) < firstfile