Words calculation program