import 'dart:async';
import 'dart:io';
import 'dart:convert';

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

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

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