private static int countGapsDashDot(String sequence){
  int count=0;
  for (int i=0; i < sequence.length(); i++) {
    int a=sequence.charAt(i);
    if (a == '-' || a == '.')     count++;
  }
  return count;
}

private static int countGapsDashDot ( String sequence ) { int count = 0 ; for ( int i = 0 ; i < sequence . length ( ) ; i ++ ) { int a = sequence . charAt ( i ) ; if ( a == '-' || a == '.' ) count ++ ; } return count ; }
count the number of gaps ( ' - ' , ' . ' ) in a sequence
