#include <iostream>
#include <vector>

class Machine{
    private:
       static int totalproduction;
       
       public:
          Machine(int itemsproduced){
              totalproduction += itemsproduced;
          }
          
          static int getTotalproduction(){
              return totalproduction;
          }
          
          static void restTotalproduction(){
              totalpeoduction = 0;
          }
          };
          
          int Machine::totalproduction= 0;
          
          int main(){
              int n;
              
              if(!(std::cin>>n)){
                  return 1;
              }
              
              if(n<0){
                  std::cout<<0<<std::end;
                  return 0;
              }
              
              std::vector<machine> machines;
              
              Machine::restTotalproduction();
              
              forc(int i=0; i<n; ==i){
                  int production;
                  
                  if(!(std::cin>>production)){
                      break;
                  }
                  
                  if (production >=0){
                      machines.emplace_back(production);
                  }
              }
              
              int total total = Machine::getTotalproduction();
              
              std::cout<<total<<std::endL;
              
              return 0;
          }