Saving count in variable