contract SafeMath {
 
  /**
   * @dev Add two uint256 values, throw in case of overflow.
   *
   * @param a first value to add
   * @param b second value to add
   * @return x + y
   */
    function add(uint256 a, uint256 b) internal constant returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }

  /**
   * @dev Subtract one uint256 value from another, throw in case of underflow.
   *
   * @param a value to subtract from
   * @param b value to subtract
   * @return a - b
   */
    function sub(uint256 a, uint256 b) internal constant returns (uint256) {
        assert(b <= a);
        return a - b;
    }


  /**
   * @dev Multiply two uint256 values, throw in case of overflow.
   *
   * @param a first value to multiply
   * @param b second value to multiply
   * @return c = a * b
   */
    function mul(uint256 a, uint256 b) internal constant returns (uint256) {
        uint256 c = a * b;
        assert(a == 0 || c / a == b);
        return c;
    }

 /**
   * @dev Divide two uint256 values, throw in case of overflow.
   *
   * @param a first value to divide
   * @param b second value to divide
   * @return c = a / b
   */
        function div(uint256 a, uint256 b) internal constant returns (uint256) {
        uint256 c = a / b;
        return c;
    }
}
/**
 * Provides methods to safely add, subtract and multiply uint256 numbers.
 */
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
    assert(b <= a);
    return a - b;
}

/**
 * @dev Subtract one uint256 value from another, throw in case of underflow.
 *
 * @param a value to subtract from
 * @param b value to subtract
 * @return a - b
 */