public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int R = sc . nextInt ( ) ;
  int C = sc . nextInt ( ) ;
  int K = sc . nextInt ( ) ;
  int [ ] [ ] cum = new int [ R + 1 ] [ C + 1 ] ;
  for ( int i = 0 ;
  i < R ;
  i ++ ) {
    String s = sc . next ( ) ;
    for ( int j = 0 ;
    j < s . length ( ) ;
    j ++ ) {
      if ( s . charAt ( j ) == 'x' ) {
        cum [ i + 1 ] [ j + 1 ] = 1 ;
      }
    }
  }
  for ( int r = 1 ;
  r <= R ;
  r ++ ) {
    for ( int c = 1 ;
    c <= C ;
    c ++ ) {
      cum [ r ] [ c ] += cum [ r - 1 ] [ c ] ;
    }
  }
  int ans = 0 ;
  for ( int x = K ;
  x <= R - K + 1 ;
  x ++ ) {
    for ( int y = K ;
    y <= C - K + 1 ;
    y ++ ) {
      boolean ok = true ;
      int jLeft = y - ( K - 1 ) ;
      int jRight = y + ( K - 1 ) ;
      if ( jLeft < 1 || jRight > C ) {
        continue ;
      }
      for ( int j = jLeft ;
      j <= jRight ;
      j ++ ) {
        int iUp = x + Math . abs ( j - y ) - ( K - 1 ) ;
        int iDown = x - Math . abs ( j - y ) + ( K - 1 ) ;
        if ( iUp < 1 || iDown > R || cum [ iDown ] [ j ] - cum [ iUp - 1 ] [ j ] != 0 ) {
          ok = false ;
          break ;
        }
      }
      if ( ok ) {
        ans ++ ;
      }
    }
  }
  out . println ( ans ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int R = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int K = sc . nextInt ( ) ; int [ ] [ ] cum = new int [ R + 1 ] [ C + 1 ] ; for ( int i = 0 ; i < R ; i ++ ) { String s = sc . next ( ) ; for ( int j = 0 ; j < s . length ( ) ; j ++ ) { if ( s . charAt ( j ) == ' x ' ) { cum [ i + 1 ] [ j + 1 ] = 1 ; } } } for ( int r = 1 ; r <= R ; r ++ ) { for ( int c = 1 ; c <= C ; c ++ ) { cum [ r ] [ c ] += cum [ r - 1 ] [ c ] ; } } int ans = 0 ; for ( int x = K ; x <= R - K + 1 ; x ++ ) { for ( int y = K ; y <= C - K + 1 ; y ++ ) { boolean ok = true ; int jLeft = y - ( K - 1 ) ; int jRight = y + ( K - 1 ) ; if ( jLeft < 1 || jRight > C ) { continue ; } for ( int j = jLeft ; j <= jRight ; j ++ ) { int iUp = x + Math . abs ( j - y ) - ( K - 1 ) ; int iDown = x - Math . abs ( j - y ) + ( K - 1 ) ; if ( iUp < 1 || iDown > R || cum [ iDown ] [ j ] - cum [ iUp - 1 ] [ j ] != 0 ) { ok = false ; break ; } } if ( ok ) { ans ++ ; } } } out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal))) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (continue_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier))) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (update_expression (identifier))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))