What is the Problem Here
package com.codegym.task.task18.task1807;
/*
Counting commas
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
try{
FileInputStream file;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
file = new FileInputStream(in.readLine());
BufferedReader f = new BufferedReader(new InputStreamReader(file));
String s;
int count=0;
while((s=f.readLine()) != null){
for(char c: s.toCharArray()){
if(c == ',') count++;
}
}
in.close();
file.close();
f.close();
System.out.println(count);
}
catch(Exception e){
}
}
}