#include <iostream>
using namespace std;
int main()
{
  int length;
  int* chain;
  
  cin >> length;
  chain= new int[length];
  
  for(int i = 0; i < length; i++)
    cin >> chain[i];

  int count = 0;
 
  for(int i = 0; i < length; i++)
  {
    int sum = chain[i];
    for(int j = i + 1; j < length; j++)
    {
        if(sum == 0) count++;
    }
    }
  }
  
  cout << count;
    
 }
