#!/bin/bash
h=0
l=0
reads=0
divider=6
while read user_input;
do
((reads++))
[ "$user_input" -eq 1 ] && ((h++))
[ "$user_input" -eq 2 ] && ((l--))
if [ "$((reads%52))" -eq 0 -a "$divider" -gt 1 ]; then
((divider--))
fi
echo " $(($((h+l))/divider))"
done