using System;
public class Program
{
static int count_digits_after_comma(double d) {
string dstr = d.ToString();
return dstr.Length - dstr.IndexOf(".") - 1;
}
public static void Main()
{
double d = 9812347.9085;
Console.Write(count_digits_after_comma(d));
}
}
/*
run:
4
*/