counting codes