$('#uploadimages input:file[value=""]').length
Accepted approach of Murtaza unfortunatelly doesn't work for me. I don't know why. https://jsfiddle.net/7vLrhqyw/
This works:
$(".count").click(function () {
var count=0;
$('#uploadimages input:file').each(function(){
if($(this).val()=="")count++;
});
alert(count);
});
Working with your example
<ul id="uploadimages">
<li><input type="file" name="gallery[]" id="upload1"/></li>
<li><input type="file" name="gallery[]" id="upload2"/></li>
<li><input type="file" name="gallery[]" id="upload3"/></li>
<li><input type="file" name="gallery[]" id="upload4"/></li>
</ul>
<input type="button" value="click" class="count"/>
Script in document.ready
$(".count").click(function(){
var count = $('#uploadimages input:file[value=""]').length
alert(count);
})