Since you are writing a small code, the simplistic suggestion to a new coder I could make is hard code it so it is:
double mol = N/6.022;
this gives you what you want. The error is because it is seeing it as 6022 instead of 6.022 since it is recognizing the . as a thousands indicator. Hope this helps.
If you do not want to hardcode the value, add:
in.useLocale(Locale.US);
right below where you declare your scanner. Both of these solutions should fix your problem.