2012 summer practice contest 2

G: Count prime