How to count occurance multiple element with a same name?

How to count occurance multiple element with a same name?


Heelo everyone...! I confused.
I could count all elements by using
  1. $(input:text).length 

But how could I count many element that has a same name?

Lets assume 

  1. <div>
  2. <input name="username" class="required" type="text" value="- none -" size="33" maxlength="50">
  3. <input name="username" class="required" type="text" value="- none -" size="33" maxlength="50">
  4. <input name="another" class="required" type="text" value="- none -" size="33" maxlength="50">
  5. <input name="sample" class="required" type="text" value="- none -" size="33" maxlength="50"></div>

How could I count that Input field only the name just the " username" ?