count & print malloc & free