///////////////////////////////////////////////////////////
/// AGC046C - C - Shift
/// https://atcoder.jp/contests/agc046/tasks/agc046_c
///////////////////////////////////////////////////////////
import 'dart:async';
import 'dart:io';
import 'dart:convert';

Stream<String> get lineStream =>
    stdin.transform(utf8.decoder).transform(const LineSplitter());

Future<List<String>> readLines() async {
  final lines = <String>[];
  await for (var line in lineStream) {
    if (line.endsWith('999999999')) {
      lines.add(line + '9');
    } else {
      lines.add(line);
    }
  }
  return lines;
}

void main() async {
  final lines = await readLines();
  final n = int.parse(lines[0]);
  var count = 0;
  for (var i = 0; i < n - 1; i++) {
    final x = double.parse(lines[i + 1]);
    for (var j = i + 1; j < n; j++) {
      final y = double.parse(lines[j + 1]);
      if ('${x * y}'.endsWith('.0')) {
        count++;
      }
    }
  }
  print(count);
}
