#!/bin/ruby S = gets.chomp puts S.scan(/mi-*n/).count