read n [[ $n =~ ^13+$ ]] echo $[${#n[$?]}-1]