CODEFORCES 393A
CODEFORCES
393A - NINETEEN
Link to Ques - Codeforces 393A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import java.util.Arrays; import java.util.Scanner; public class CF393A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a[]=new int[4]; String str = sc.nextLine(); for(int i=0;i<str.length();i++) { char ch = str.charAt(i); if(ch=='n' || ch=='N') a[0]++; else if(ch=='i' || ch=='I') a[1]++; else if(ch=='e' || ch=='E') a[2]++; else if(ch=='t' || ch=='T') a[3]++; } a[0] = (a[0]-1)/2; a[2]/=3; Arrays.sort(a); System.out.println(a[0]); } } |
Comments
Post a Comment