program Project1;

var f:text;
    g:text;
    c:char;
    b:integer;
    s, cnt:longint;
    m:real;

function bl(c:char):integer;
begin
  Result:=-2;
  case c of
    'A':Result:=4;
    'B':Result:=3;
    'C':Result:=2;
    'D':Result:=1;
    'F':Result:=0;
    ' ':Result:=-1;
  end;
end;

begin
    assign(f, 'input.txt');
    reset(f);
    assign(g, 'output.txt');
    rewrite(g);
    cnt:=0;
    s:=0;
    while not eoln(f) do begin
      read(f, c);
      b:=bl(c);
      if b>=0 then begin
        cnt:=cnt+1;
        s:=s+b;
      end else if b = -2 then begin
        write(g, 'Unknown letter grade in input');
        close(f);
        close(g);
        halt(0);
      end;
    end;
    close(f);
    if (cnt > 0) then
      m:=s/cnt
    else
      m:=0.0;

    write(g, m:0:2);
    close(g);
end.
 