#!/bin/bash for i in {0..12}; do ones[i]=0 zeroes[i]=0 done while read -r line; do n=${#line} for ((i=0; i zeroes[i] )); then ((gamma++)) else ((epsilon++)) fi done echo "gamma=$gamma epsilon=$epsilon product=$((gamma * epsilon))"