Hello, I write simple slideshow on jQuery but I can't understand how to change current image count. Help me please.

Here is my current code:
HTML Code:
<script type="text/javascript"> 
	$(document).ready(function(){
	$('#slideshow img').hide();
	$('#slideshow img:first').show();
	
	function slide(){
		var $top = $('#slideshow img:visible');
		var $next;
		
		if ($top.next().length > 0)
		$next = $top.next();
		
		else
		$next = $('#slideshow img:first');
		$top.hide();
		$next.show();
	}
	var $imgCount = $('#slideshow img');
	var $iCount = $imgCount.length;
 
	$('#slideshow img').click(slide);
	$('#totalImages').text($iCount);

	});
</script>
I'm trying make like this 2/45, where 2 - is current image number.
Thank you.