int count = key.length() - key.replaceAll(":", "").length();.net
int count = key.length() - key.replaceAll(":", "").length();